The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Automation: Link multiple issues from JQL lookupissues

Tom Wick
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!
July 2, 2021

I am trying to develop and automation that can perform a JQL lookup and then link all of the matching issues to the originating ticket.

 

I have the trigger, lookup, and edit functions working if the JQL only returns a single field, but if the JQL returns multiple fields the edit issue function attempts to link "issue-1,issue-2" which causes an error. Is there a way to iterate over the {{lookupissues}} variable and pass each instance to the "Edit Issue fields" function?

 

To add some color this is for our security team who wants to track certain fields like bad-actor IP addresses across tickets, so if bad ip 1.2.3.4 gets added to a special field in the ticket, other issues with that IP in the same field should be linked automatically.

 

For reference this is my current "Edit issue Fields" Function:

{"update": {
"issuelinks": [
{
"add": {
"type": {
"name": "Relates"
},
"outwardIssue": {
"key": "{{lookupissues.key}}"
}
}
}
]
}
}

This is the whole workflow if that's helpful:

automation_flow.png

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Answer accepted
Alex Koxaras -Relational-
Community Champion
July 2, 2021

Hi @Thomas Wick 

Will the following automation works for you?

  • Leave the trigger event as you have it
  • Instead of using the lookupissue, use the branch component and choose JQL
  • Write on the JQL the statement you had on your Lookupissue component
  • Inside the branching edit only the linked issue parameter (see pic below)
  • Continue with the rest of your changing on the triggered issue, outside the branching rule

 

linked.png

 

Hope that this was what you well looking for. I tried it, and successfully managed to linked all the issues on my JQL to the triggered issue.

Let me know!
Alex

Tom Wick
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!
July 6, 2021

@Alex Koxaras -Relational-  That worked great. Thanks for the help.

Alex Koxaras -Relational-
Community Champion
July 7, 2021

Nice! Good to know! :) 

Charlie Misonne
Community Champion
March 23, 2022

This is the answer!

Thank you :-)

0 votes
Utkarsh Singh
January 27, 2022

@Alex Koxaras -Relational- can you help me in telling me what to do if we want to have a manual trigger, because linked issue is showing only Trigger Issue or recently created issue.

How to link any ticket ?