Notify Hipchat when JIRA custom field is changed

It's very quick to add a Post-Function into a workflow to notify HipChat (upon creation or status change) if the issue matches certain criteria.  My question is how do I notify HipChat if a particular field has change (i.e., Risk of Delay custom field updated to High)?  No transition happens in the workflow upon a ticket being updated so I'm struggling to figure out how to notify Hipchat.

2 answers

Hi Ryan,

 You probably need a Webhook

That's a good suggestion.  I actually tried doing it with Script Runner using a Listener for 'Fast-track transition an issue'.  That actually works in theory.  My problem is that the post-function for Notify HipChat for some reason doesn't work on transitions setup as from Any Status to Itself.  That post-function works on any other type of workflow transition except for that for some reason, which is the one I need to use for scalability.  Maybe that's just a JIRA bug they need to fix.

I suppose ScriptRunner and a listener could do the trick as well. 

For example in a custom listener you could see which field was updated (in an issue updated event) and in your script you cold have something like 

def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field == "priority"}
if (change) {
    // make a rest call to HipChat or via applicationLinks 
    log.debug "Old priority: ${change.oldstring}"
    log.debug "New priority: ${change.newstring}"

I appreciate the input Thanos.  It looks like you're suggesting in the code comment to make the notification to HipChat via the script (as opposed to triggering the post-function in the workflow).  Since i'm having troubles with the post-function working correctly i'm interested.  Are you up for giving me a bit more direction on what that call would look like?


Actually what I would suggest as the first choice is it to try with a webhook ...

I'm reading up on Webhooks but am extremely new to it.  Can the webhook be completely done from the JIRA side or does something need to be setup on the HipChat side too?  What should the URL be setup as (none of the things I tried worked)?

I'm thinking the listener is still better because i can specify exactly what field needs to have changed.  In the Webhook I can fire when the issue is updated but there's no guarantee the field in question changed or wasn't just changed to my desired value a while back.  Is the code to make the rest call to HipChat a difficult one via a listener?

Has anyone else written a call to HipChat from within a custom listener? I'm trying to figure out the right syntax for that.

Was able to figure out how to fire off HipChat notifications using the Scriptrunner custom listeners.  Combined scripting from and to make it work.

Hi Ryan Deyer:

Can you share your listeners example codes?  We are trying to do the same process of notifying Hipchat room when a project's issue get transition via a specific WF.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,231 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you