Hello,
I need a ScriptRunner (Cloud) script that uses the linked issues condition to control whether or not a user can transition an issue based on the issuetype, Ex: This scenario is for Changes, however, if the source of the change for Incident, Problem or Request, a message should appear that is mandatory to link to issue.
Can someone help me?
@Thony -
Welcome to the community. Please take a look at this reference example page for how to create a ScriptRunner validator for WF transition - https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/jira-expression-examples
- https://docs.adaptavist.com/sr4jc/latest/features/workflow-extensions/validators
As the Cloud version uses Jira expression framework syntax to support ScriptRunner validator configuration - https://developer.atlassian.com/cloud/jira/platform/jira-expressions/?_ga=2.180053924.1089527298.1697076386-1944562691.1685750835
In the first reference link mentioned above, there is already an example for making linked issue required as documented in ScriptRunner documentation -
Lastly from the same example documentation - here is the code checking for issuetype (where you should combine it with the linked issue setup at a high-level)
On the WF front, I would recommend that each issue type has a different custom WF setup for your project, so it will make your WF customization simpler. This means that the WF currently being used for Incident issue type is its own WF and it is not shared with Problem issue type or Request issue type.
Hope this gives you a good starting point to generate your solution.
Best, Joseph Chung Yin
Jira/JSM Functional Lead, Global Technology Applications Team
Viasat Inc.
Hi @Peter Sarkar,
I am from Forgappify, and we couldn't find an easy way to accomplish this in Jira Cloud using other apps, and it is not possible in Jira out of the box. Therefore, we have created the Linked Issues Validator as part of the free Workflow Building Blocks for Jira app.
Please take a look at the configuration below. You can select the issue type of the linked issue that should exist. To make it required, check the "At least one linked issue, as defined above, must exist" box.
I hope it will help.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyone able to confirm if they were able to add a script to validate the issuetype of a linked issue on a transition?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter:
Have you tried my above recommendation to the original reporter who asked the question in the beginning?
If not, please try it out.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was not able to get it to work. I need to enforce an issue is linked during a transition, the issue being linked must be a Change issue type, and that it is linked using a specific issue link.
I've only been successful requiring an issue is linked using the first example of your post.
Thanks,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter:
Without custom development, you may need to obtain a third party add-on which can simplify your WF customization with minimum development effort. I would recommend you to take a look at Jira Misc Workflow Extensions (JMWE) for Cloud -
They have a build-in Linked Issue Validator configuration that you can utilize where you can check for issue type of the linked issue in your WF transition - https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466323119/Linked+Issues+Validator
Hope this helps.
Best, Joseph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.