Forums

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

How to retrieve linked issue key by automation ?

Boyd Hong
Contributor
September 18, 2023

Given that my company have two JIRA projects, Project A (Incident) and Project B (Improvement).

I have created an issue to report an incident in Project A for example; INC-001

and we also report the incident to Process Owner team, they create a backlog issue on their Project B for example; PRO-009.

So we inwards link issue INC-001 to PRO-009 like this 

"INC-001 is affected by PRO-009" 

Somehow, INC-001 has a dependency to PRO-009 and could not be closed if PRO-009 is not moved to "Done". 

 

In this situation, i create a global automation to detect that... when PRO-009 is transited to "Done", then.. the automation will write down a comment  in INC-001 issue like this..

 


INTERNAL COMMENT:

Update: {{triggerissue.key}} is moved to "Done", please the assignee of INC-001 proceed to the next step.


 

However, i have tried several smart-value such as {{triggerissue.issuelinks.inwardIssue.key}} to ensure that the automation can retrieve the key that PRO-009 is linked by (In this case, INC-001), but somehow it returns nothing.

Please someone advise me what is the correct structure of smart-value that i can put in the automation. Thank you.

 

 

 

1 answer

1 accepted

1 vote
Answer accepted
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 18, 2023

Use:

 {{triggerissue.issuelinks.get(0).inwardIssue.key}}

Note this will only give you the first link that is mentioned in your issue.

If you want to loop over all the links, you should add an advanced branch with {{triggerissue.issuelinks}} and ilink as var. Then you can use {{ilink.inwardIssue.key}} in your comment. Maybe add a condition to be sure the link is to the correct project.

Boyd Hong
Contributor
September 18, 2023

Hi @Rudy Holtkamp  thanks a lot. It works wonderfully!

I have some more question. I've tried to do advanced branching, before that i added 2 more issues from Project C and Project D, however when i tested by commenting the variable ilink both inward and outward, they do not return any results. So i wonder how loop technique is set up. Can you advise again? Thanks.

messageImage_1695047060690.jpg

1695047188077.jpg

Suggest an answer

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

Atlassian Community Events