Jira Listener Not Detecting Issue Updates

I have series of ProForma forms that are submitted as issues to the Jira Service Desk.

I needed to run some scripts against these issues after they were created and fast-tracked into a Queued state.  I elected to run a Groovy script as a Listener on Issue Update. The thinking was that because the state of the ticket was being updated from Open to Queued, the Listener would have plenty of material to work with.

The issue that I encountered was that the listener was only detecting some of the issues.  I enabled logging at the outset of the Listener script and told it to record any ticket that was subject to an Issue Updated event.  Some of the issues created by the forms weren’t being detected by this at all. At the same time, some of them were.

The issue was consistent, in that certain forms were never detected by the listener, and certain forms were always detected.  There was no appreciable difference in the form setup or the way the tickets were processed.  The Listener script itself simply examined the Request Type field of each ticket (which is a Jira Core field), and routed the ticket based on that value. All of the forms had that field.

The answer was that only forms with linked custom fields were being detected.  In other words, only the populating of the linked custom field with the value of the field on the form was being picked up by the Listener.   If the form did not have a custom field, or if that custom field was not populated with a value, the Listener didn’t consider that issue to have ever been updated.  This, despite the fact that every one of the issues had been subject to a Status change.

The solution was simply to turn one of the fields on each form into a mandatory custom field. It didn’t even need to show up on the Issue screen, it simply needed to be populated with a value as part of the Issue creation process.

As is so often the case, the easy part was solving the problem. The hard part was nailing down what the problem actually was!

 

Leave a Reply

Your email address will not be published. Required fields are marked *