December 8, 2022

ScriptRunner Listener for Suspect flagging

I share in this post how to implement a suspect mechanism in Jira using a ScriptRunner listener.

Challenge description

It is common wish for ALM tools to want to flag issues if a parent linked issue was modified, so that you can later make a change impact analysis; this mechanism is called "suspect link or flagging".

R4J Limitations

R4J Jira Add-On for DataCenter/Server provides also a suspect functionality
Unfortunately, it is a bit hard to customize. For example you can not distinguish between different types of Suspection (like one for reuse, another one for changed after approval)
Also, you can not define a global (=valid for all projects) suspect configuration i.e. you have to duplicate configurations across multiple projects if you need to.
For the cloud version as for now (2022-12-08), you also need to use such an automation. Documentation recommends using Jira Automation.

I present in the next section how to use ScriptRunner for this purpose.

ScriptRunner Solution

You can implement such a mechanism with ScriptRunner using a Listener.
Create a listener for the event 'Issue Updated'.


Script


This script will be triggered if a list of fields was changed (listed in the variable suspectFieldNames).
It will then go through the issues linked via the Reuse link (type inward) and flag/ label these issues with 'suspect_reuse'. The link type and direction as well as the label name are here hard-coded: you might want to adapt them for your need.
A nice comment with references to the parent issue and changed fields will also be written documenting the suspect flagging.

See also

Configuring Suspect Logic - R4J Cloud - Requirements Management for Jira - Confluence

No comments:

Post a Comment