Automation: Link multiple issues from JQL lookupissues

Tom Wick 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

2 votes
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 July 6, 2021

@Alex Koxaras _Relational_  That worked great. Thanks for the help.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2021

Nice! Good to know! :) 

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 ?

Suggest an answer

Log in or Sign up to answer