11

I am working currently on integration between Jenkins to Slack, I want to fully control Jenkins from slack, basically, I want to trigger jobs, and I want to answer input if it exists. for e.g

pipeline{
    agent any
    stages{
        stage('Test Notification success stage'){
            steps{
                script{
                    env.createofflinepkg = input message: 'User input required',
                    ok: 'Submit',
                    parameters: [choice(name: 'Create Offline Package', choices: "Create\nSkip", description: 'Create Offline Package or Skip')]
                }
                slackSend (channel: 'input-response',color: '#ffff00', message: "Yellow at general : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
            }            
                
        }
    }
}

I want this to be sent to slack and then I could answer this from slack, there is a way to do this? Thanks in Advance.

UnityNewb
  • 361
  • 1
  • 5
  • 17

1 Answers1

0

I don't know if this is exactly what you are after. If you are sending ${env.BUILD_URL}/input URL to slack, that should redirect you directly to the approval page from Slack to Jenkins approval page.