How to copy assignee from linked issue to trigger issue?
Asked by Dmytro Shaforost:

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!


Answers:
author: Kevin Suter
body: 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.

comments: author: Jason M_
body: Its been 2 years, but this deserves a callout \& a thanks for such a highly succinct \& informative answer!


author: Bill Sheboy
body: Hi [@Dmytro Shaforost](/t5/user/viewprofilepage/user-id/4380830)

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

comments: author: Dmytro Shaforost
body: Thanks [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) 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


author: Dmytro Shaforost
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) can you help with that?


author: Bill Sheboy
body: 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](https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/#Smartvaluesgeneral---lookupIssues--) and [lists](https://support.atlassian.com/jira-software-cloud/docs/smart-values-lists/) to learn about size:

{{lookupIssues.size\|0}}


author: Diogo Teles
body: [@Dmytro Shaforost](/t5/user/viewprofilepage/user-id/4380830) I had a similar issue just now. Using [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) '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](https://community.atlassian.com/t5/image/serverpage/image-id/321860iC9DC5296096016E0/image-size/large?v=v2&px=999 "image.png")

![image (1).png](https://community.atlassian.com/t5/image/serverpage/image-id/321861iBEB382B68D8D89EA/image-size/large?v=v2&px=999 "image (1).png")