Forums

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

How to get one specific linked issue type in automations?

Khira Niemeier
Contributor
September 24, 2024

We have an Automation that is supposed to change the Parent of a Subtask to the linked Issue of its parent and it worked fine with just one cloned issue.

It is using:

"key": "{{issue.parent.issuelinks}}"

Now we have the problem that there is more than one linked issue on the Parent and it doesn't work anymore (as it can't insert more than one key).

How can I grab only the "clones" linked issues of the parent?

I already tried these and I am running out of ideas:

"key": "{{issue.parent.issuelinks.clones}}
"key": "{{issue.parent.issuelinks(clones)}}
"key": "{{issue.parent.linkedIssues(clones)}}
"key": "{{issue.parent.linkedIssues.clones}}
"key": "{{issue.parent.linkedIssues"clones"}}


Please send help :D

2 answers

2 accepted

0 votes
Answer accepted
Khira Niemeier
Contributor
September 25, 2024

After @Bill Sheboy helped me understand how filtering lists works, I could fix my automation.

Just in case somebody needs a similar automation I will leave the details here. :)

Screenshot (5).png

When a Subtask is created the automation clones it and afterwards uses "for: most recently created issue" to edit the Parent (which assignes it not to its own Parent, but the Issue the Parent was cloned from).

So this Automation is for Issues where you want a copy from and if you add Subtasks you want to make sure they are going to be in the original issue as well.

Screenshot (6).png

for copy paste:
"key": "{{#issue.parent.issuelinks}}{{#if(equals(type.outward, "clones"))}}{{outwardissue.key}}{{/}}{{/}}"


In general I learned filtering the lists works with the link direction wich are: inward and outward (or both).
So in our case above as it is "clones" it uses "outward". If it was a "is cloned by" link it would be inward.

Thanks again - this really helped me a lot. <3


Bill Sheboy
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.
September 25, 2024

I am glad to learn that helped, and...

Your rule uses the Issue Created trigger.  That one can fire so quickly that some data may not yet be available to the rule.  This may cause unexpected behavior (e.g., incorrect condition results) or errors.

To solve this I recommend always adding the Re-fetch Issue action immediately after the Issue Created trigger.  This will slow down the rule a bit and reload the data before the rule proceeds with processing.

Khira Niemeier
Contributor
September 26, 2024

Thank you so much.
We actually sometimes had Automation-Hickups so I will add this to our Create rules now. :) 


Like Bill Sheboy likes this
0 votes
Answer accepted
Bill Sheboy
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.
September 24, 2024

Hi @Khira Niemeier 

Please see my response to your other question, for the same need, here:

https://community.atlassian.com/t5/Jira-questions/Re-Re-Smart-Values-Linked-Issues/qaq-p/2820601/comment-id/1053889#M1053889

Kind regards,
Bill

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