Forums

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

Fetch a specific Linked Issue and copy to another custom field

Chris Delgado
Contributor
September 5, 2023

Hi, 

 

As the title stays, I'm trying to achieve the following using Automations. 

 

1. If issue for example - RCA-#### links an issue (SS-####) as has the Concern 

2. Fetch that issue key = SS-#### and copy the string into another custom field, let's call it Linked Issue Keys.

 

I have tried multiple automations but none of them seem to be able to fetch the linked issue I'm looking for.

 

I'm very open to ideas, I have also tried doing this in JMWE and using nunjucks but no sucess either.

 

 

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
September 5, 2023

At which point are you trying to copy this field? During a transition? When the field value changes?

Chris Delgado
Contributor
September 6, 2023

I want to copy this as soon as a ticket is linked as 'Has a Concern', it can be at any time.

Chris Delgado
Contributor
September 6, 2023

chrome_FJn8xEAxhc.png

David Fischer
Community Champion
September 7, 2023

In JMWE, you can use an Event-based action listening to the Issue Link Added event. Select the "Only apply to issues that match a Nunjucks condition" option and use this Nunjucks filter:

{{ context.issueLink.issueLinkType.name == "Issue Link Type Name (not direction)" }}

(replace the link type name with the name of the link type as it appears on the Issue Linking Jira admin page)

Then you'll use a Copy Issue Fields in the post-functions section, and select the appropriate From and To issues. For both, you'll use the "Issues returned by the following Nunjucks Template" option. Assuming "has the Concern" is the outgoing link direction name, you'll use these as the Nunjucks templates:

- Source: 

{{ context.issueLink.sourceIssueId }}

- Destination:

{{ context.issueLink.destinationIssueId }} 

And then select the field to copy.

If it erases the field on the "source" issue instead of copying the value, swap the two Nunjucks templates above. 

image.png

image.png

Chris Delgado
Contributor
September 14, 2023

I was actually able to do this with JMWE and now just seeing your answer is very similar to mine. 

 

Thank you!

Suggest an answer

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

Atlassian Community Events