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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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}" }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ryan,
Actually what I would suggest as the first choice is it to try with a webhook ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Has anyone else written a call to HipChat from within a custom listener? I'm trying to figure out the right syntax for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was able to figure out how to fire off HipChat notifications using the Scriptrunner custom listeners. Combined scripting from https://scriptrunner.adaptavist.com/latest/jira/listeners.html#_custom_listener_example and https://www.hipchat.com/docs/apiv2/method/send_room_notification to make it work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.