Forums

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

Jira Automation: Copy from Issue

Todd Palermo
Contributor
July 7, 2021

Hello experts, I have an automation problem that I need help with. On Create or Update, I would like to copy fields from a source issue to the trigger issue. The source issue and trigger issue are in the same Project, but different issuetypes.

Project = TPR
Issuetype = Unit and CBU

Issuetype Unit and CBU have something in common. Unit Issue Key is equal to a custom field in CBU.

Example: Issuetype Unit and CBU have a custom field called Code. In issuetype Unit, Code is populated. I would like to have issuetype CBU look this value up and write it to it's Code field.... Kind of syncing the data between Unit and CBU when CBU is created or updated.

Here is what I have now to maybe explain a little more;

When: Rule is triggered on
-Issue Created
-Issue Updated

For JQL
project=TPR AND issuetype = Unit AND key = {{issue.customfield_123.key}}

Then: Edit Issue fields
Code - Copy from trigger issue

Customfield_123 is only in CBU issuetype, so this will only be successful in that type.

Copy from trigger issue isn't right because I want it to copy from the JQL search and not the trigger issue (BTW, it will only yield 1 result because it is the key).

Is there a way to do this in Automation? I know I can do this in Scriptrunner, but I am trying to keep it kind of clean for future editors.

1 answer

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Champion
July 8, 2021

Hi @Todd Palermo

Correct me if I'm wrong: Upon creation or update of a CBU issue type, you want to search for the Unit issue type, acquire certain fields which you want to copy back on the trigger issue (CBU issue type), right?

Todd Palermo
Contributor
July 8, 2021

Hi @Alex Koxaras _Relational_ Yes! That is right. Is there such a way?

Todd Palermo
Contributor
July 8, 2021

Hi @Alex Koxaras _Relational_ , A very clever member of our team has solved the case today. A little competition on solutions are always helpful. We already had an automation that when the 1 Unit was updated, it would then update all CBU issues that were common. Our solution was to change the Then automation to Then: Publish the issue event Issue Updated. Thanks for your assistance with this one!!

Alex Koxaras _Relational_
Community Champion
July 8, 2021

I'm glad you solved this one! Very nice!

Marina Gharios
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!
January 10, 2023

Hi @Todd Palermo , would you mind / still have the actual automation solution that you could share here please? I'm working on a similar logic,  to be able to copy field values from one linked issue to another. Thank you in advance!

Todd Palermo
Contributor
January 10, 2023

Hi @Marina Gharios , the solution that we use is with the JWT plugin in a Post Function. The triggered issue has a field that contains the Key of another issue. The Post Function copies a field value from the Key issue to the current issue (in the same or different field). This might not be what you are looking for as this linked issue isn't using the Jira Link or Web Link feature. We have a custom choice field that has the value of a field from a JQL search. The value is shown in the view, but behind the scenes it really is the Key of the issue.

The JWT Post Function is called: Copy field values from multiple issues.

Good luck!

Marina Gharios
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!
January 10, 2023

@Todd Palermo Thank you for the details and context! 

Suggest an answer

Log in or Sign up to answer