Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to copy assignee from linked issue to trigger issue?

Dmytro Shaforost
Contributor
November 23, 2021

How to copy assignee from linked issue to trigger issue?

Hi, guys!

Need help in Jira Automation again

I need to create automation rule for next case:

When Issue status change from "A" to "B"

AND Component EQUALS to "SOME"

Then COPY assignee field from Linked Issue WITH Type = Story TO Trigger Issue 

 

Thanks a lot for your help!

 

2 answers

2 votes
Kevin Suter
Contributor
June 17, 2022

The following procedure worked for me to copy the assignee from a freshly linked issue:

1. Link the issue you want to link with the "Link issue" action
2. Call the "Re-fetch issue data" action
3. Use the "Edit issue" action (assignee) with the smart value {{issue.issuelinks.first.inwardIssue.assignee}}

Probably only step 3 is relevant for your use case. I just wanted to point out how it works if you just linked the issue in the same automation rule.

Remark: Mind the direction of the issue link. If the issue you want to edit has an outgoing connection, you'll have to replace inwardIssue by outwardIssue.

Hope this helps.

Jason M_
Contributor
May 15, 2024

Its been 2 years, but this deserves a callout & a thanks for such a highly succinct & informative answer!

Zach Taylor October 25, 2024

This helped me as well. Such a great post, THANK YOU!

 

2 votes
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.
November 23, 2021

Hi @Dmytro Shaforost 

What have you tried thus far to solve this? 

I recommend using a branch or lookup issues to find the linked issue, save the assignee, and then you should be able to update the trigger  issue.  If you decide to use the lookup, you can directly use the value in the edit.

  • trigger: issue transition
  • action: lookup issues on JQL to get a linked issues of that type
  • condition: the lookup count equals 1
  • action: edit issue to copy the assignee from the lookup

Kind regards,
Bill

Dmytro Shaforost
Contributor
November 24, 2021

Thanks @Bill Sheboy i give up :( i can't write jql request to get a linked issues of that type... I don't understand how to get list of linked issues with type story from trigger issue

and how to set a condition count = 1

 

Dmytro Shaforost
Contributor
November 28, 2021

@Bill Sheboy can you help with that? 

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.
November 29, 2021

Please try to use the linkedIssues() function:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-linkedIssueslinkedIssues--

For example, to find the linked stories for the trigger issue:

issue IN linkedIssues( {{triggerIssue.key}} ) AND issueType = Story

Please also look at the documentation for lookupIssues and lists to learn about size:

{{lookupIssues.size|0}}

Like Dmytro Shaforost likes this
Diogo Teles
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.
May 3, 2024

@Dmytro Shaforost I had a similar issue just now. Using @Bill Sheboy 's insight I was able to implement it. This is how I tested it (hene the manual trigger and lack of other conditions), you can adapt from it:

image.png

image (1).png

Like Jeroen Cornelis likes this
Jeroen Cornelis
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!
November 22, 2024

Hi @Diogo Teles 

This worked for me, thank you! But is there a way to let this automation run automatically instead of via manual trigger?

When an issue is created and afterwards gets assigned to somebody I need the assignee to be copie to the trigger issue automatically.

 

Thanks in advance!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events