Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Linked issue validator based on issuetype

Thony
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 11, 2023

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?

3 answers

1 vote
Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 11, 2023

@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 -

2023-10-11_19-28-51.png

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)

2023-10-11_19-31-43.png

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.

0 votes
Maciej Dudziak _Forgappify_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2024

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.

community_23.04_require_linked_issue.png

I hope it will help.

Cheers

 

0 votes
Peter Sarkar
Contributor
December 8, 2023

Anyone able to confirm if they were able to add a script to validate the issuetype of a linked issue on a transition?

Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 8, 2023

@Peter Sarkar -

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

Peter Sarkar
Contributor
December 9, 2023

@Joseph Chung Yin 

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

Joseph Chung Yin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 9, 2023

@Peter Sarkar -

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 -

https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe?tab=overview&hosting=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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events