1

I can find tons of information in the internet about integrating HipChat in a scripted Jenkins pipeline. So that works fine for me. But how can I post a status message to HipChat that contains an element to trigger an action back in Jenkins?

Currently I have input steps in Jenkins to approve a deployment to the next stage, e.g. PROD.

I also send a HipChat message if approval is needed which contains a link to JENKINS. That looks like this:

hipchatSend color: "${color}", notify: true, room: "Jenkins Team FooBar", message: "${env.JOB_NAME}#${env.BUILD_NUMBER}: ${message}", textFormat: true

/************** PROD **************/
stage ('Approval for PROD') {
    try {
        timeout(time: approvalTime, unit: approvalTimeUnit) {
            input 'Do you approve the deployment to PROD?'
        }
    } catch (Exception ex) {
        finishBuild = true
    }
}

// Stop build if flag was set
if (finishBuild)
    return

How can I define actions in that hipChat message? Is there a way that I can approve the next build step within HipChat?

I have not found a tutorial or documentation on how to define other kinds of hipchat messages with this plugin.

I could send a POST request to JENKINS if the message would contain standard HTML. Any ideas on how to do that?

How would it work with cards?

Thanks in advance.

daspilker
  • 8,154
  • 1
  • 35
  • 49
Patrick T
  • 294
  • 3
  • 11

0 Answers0