Copying fields to new issue that gets linked to existing issue
Asked by Benjamin Beach:

Hello, I am trying to write a rule in Automation for Jira Cloud so that when I create a new issue B and link it to an existing issue A from the create screen, the rule will copy some field from the existing issue A to the new issue B.

I have tried all sorts of variations of the rule using the Issue Linked trigger and the linked issues branch rule, and the rules say they executed successfully, but nothing gets copied to the new issue B.

From examining the audit log, I know that the Destination issue is B and the Source issue is A. In the "Copy from" action there is not an option for copy from "Source Issue". I tried "Current Issue" and that does not work.

Has anyone done something like this successfully? Thanks in advance!

Ben


Answers:
author: Stefan Salzl
body: Hi [@Benjamin Beach](/t5/user/viewprofilepage/user-id/4358254) ,

Destination / Source depends on the linking goes inward or outward from the issue you are creating:

means:  
if you create task B with link "causes Task A" --\> Task A is the destination/Task B the source

if you create task B with (inward) link "is caused by Task A" --\> Task A is the source/Task B the destination.

In order to provide a fitting solution it would be good to know the exact requirements (is there a specific link you want to match/catch?)

Best  
Stefan

comments: author: Benjamin Beach
body: Hello Stefan,

Thanks for your reply. I was originally using the "relates to" link, but the inward and outward links are the same. So I was just testing without specifying a particular link type, and got the same results. But the copy function only lets you choose from "Current issue, Trigger issue, Parent issue, Epic issue, or Destination issue" Which would you use for source issue?

I appreciate your help!

Ben


author: Stefan Salzl
body: Hi [@Benjamin Beach](/t5/user/viewprofilepage/user-id/4358254) ,

one more question from my side:

should this rule be limited to the the case where link is set during creation of a new issue or should this always be triggered when linking is set (also in already existing issues) ?

This might be an important requirement to choose the right trigger of the rule.

Best  
Stefan


author: Benjamin Beach
body: Hello Stefan,

I would like for it to trigger in either case - when linking an issue during creation or adding a link to an existing issue. In both cases, I am looking to have fields copied from the issue I am linking to.

Thanks so much!

Ben


author: Stefan Salzl
body: Hi Ben,

hmmm......it?s really tricky hahaha.....especially for the "relates" linking as this has just 1 direction and no inward/outward.

In fact I?m able to do a copy successfully (also depends on which fields you want to copy).

BUT: it really depends (and that could get "dangerous") which of the 2 issues triggers the rule. You know what I mean?

<br />

So maybe for better understanding (referring to your introduction):

Let?s say Task A has the fields the should be given/copied to a newly linked issue.

There is a big difference then if you create the link out of Task A or out of Task B.

Because in one case fields would be copied from task A to task B (which might be your expected solution) but if you create the link the other way round then the fields would be copied from task B to task A =S


author: Stefan Salzl
body: Hi [@Benjamin Beach](/t5/user/viewprofilepage/user-id/4358254) ,

there is a really good community entry regarding linking:  
<https://community.atlassian.com/t5/Jira-questions/Issue-links-what-is-the-meaning-of-quot-inward-quot-and-quot/qaq-p/839095>

soooo......I just created an example for the linking of "blocks/is blocked by" for some investigation and as this better describes the inwar/outward - source/destination thing.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/183096iA8B19F8BF4657560/image-size/large?v=v2&px=999 "image.png")  
Using the "Issue linked" trigger the audit log will always tell you which issue is source and which one is the destination:

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

Hope this helps a little bit or gives at least a bit more input for further investigation or experiments.

Just let me know if there is more input or further question from your side. Really curious to find a solution here :)

Best  
Stefan


author: Benjamin Beach
body: Hi Stefan,

Thank you so much for all the effort and thoughts you have shared. I really appreciate it! I will look at this and give it a try and I'll be sure to let you know how it goes!

Best regards,

Ben


author: Stefan Salzl
body: You are welcome Ben :)

Sharing is caring and by trying to figure out solutions with my current experience I always learn a lot too :) So this is a win-win ;)

Looking forward to hearing from you how it works ;)

Best  
Stefan


author: Mykenna Cepek
body: The technique I illustrated recently to answer this other question...

<https://community.atlassian.com/t5/Automation-questions/Adding-watcher-to-subtasks/qaq-p/1939011>

...might work in your case also.

comments: author: Benjamin Beach
body: Thanks for your reply, but this does not help me. I am not creating subtasks or any issues in the rule. My trigger is when the issue is linked, and I'm trying to copy fields from the linked issue to the issue I just linked to it.


Tags: issue-link