Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira expression for issue type of linked issue

Robert Wen_Cprime_
Community Champion
July 10, 2023

I have a validator I need to apply on a transition in JSM cloud where not only should there be a linked issue, but the issue type of that linked issue should be Incident.

So far I have the following for the existence of linked issues

issue.links.length > 0

Anyone know what the rest should be?  I know the following is the reference

https://developer.atlassian.com/cloud/jira/service-desk/jira-expressions-type-reference/#issuelink 

1 answer

1 vote
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.
March 15, 2024

Hi, Jira expression needed would be like below:

let linkedIssues = issue.links
.map(link => link.linkedIssue)
.filter(issue => issue.issueType.id == 10004);
linkedIssues.length >= 1

where 10004 is ID of the issue type, you need to find it for your instance.

To simplify such cases, we've developed the Linked Issues Validator, available as part of the free Workflow Building Blocks for Jira app. With a wizard-like UI, you can easily select options that represent your case. In the Jira Expression Preview, you'll see how the app constructs the expression behind the scenes. If your case is more complex, you can use it as a foundation for your own expressions.

Validator_Bug_issue_type_required.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events