Update custom field when ticket is linked

Danilo Simic August 11, 2022

I am having some trouble with automation rules.

This is the scenario that is happening:

  1. For ticket A XYZ field is empty
  2. For ticket B XYZ field has a value
  3. Open ticket A
  4. Link ticket A with ticket B

Expected outcome:

  • Field XYZ in ticket A gets same value as field XYZ in ticket B

2 actual outcomes (depending on rule setup):

  1. Field XYZ in ticket B gets value as field XYZ in ticket A (value is cleared, field is now empty)
  2. Nothing happens (Audit log for automation rules says "Success")

 

I have tried to setup the rule to copy the field value from the destination ticket and from the trigger ticket, this did not work. I have also used the function {{destinationIssue.customfield_123}}, this also did not work.

Is this maybe a Jira limitation?

 

1 answer

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 11, 2022

Hi Danilo,

Can you share the actual automation rule with us? 

Danilo Simic August 12, 2022

Hi John, this is the original setup. This setup produced the 1st outcome that I mentioned.

 

1.PNG

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 12, 2022

Thanks for sharing. So what do you mean by it didn't work? It said successful but didn't copy the value? 

Is there a specific link type that your users should selecting? Or literally any can be used? What was the specific link you used in your test? 

Danilo Simic August 15, 2022

Any link can be used, I have tested with multiple link types.

When linking ticket A with ticket B (in the ticket A screen), the desired outcome is that the field value from ticket B is copied to the same field in ticket A.

The actual outcome is that the field value in ticket A is copied to the same field in ticket B. So basically the outcome is the reverse of the desired one.

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2022

Hi @Danilo Simic 

It seems like the link source vs destination is not the expected order when it comes through to the automation rule. Can you verify this by logging out `{{destinationIssue}}`?

The issue link trigger has a description on the context in which a link trigger executes:

Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}

It seems that the rule in question would be executing on issue B, copying over destination issue (A) field.

To fix this, what you can do is do a 'Related Issue Branch' component, and select 'Destination Issue' as the issue type.

Then, inside the branch, Edit Issue as you have done, but instead use `{{triggerissue.customfield_123}}`. I believe that should solve this problem for you.

Hope that helps
Sam

Danilo Simic August 17, 2022

Hi Sam,

This solved the issue.1.PNG

 

Here is the screenshot of how the rule is setup now.

Thank you everyone for the help, it is much appreciated.

Like # people like this
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2022

Hi Danilo,

Glad it worked for you.

Just a note on the rule you have now, the branch type there being 'For linked issues'  means it will execute the actions on all linked issues, not just the link that triggered the rule. If that's desired, then not a problem. For the case where you just want it purely for the link that triggered the rule, then the branch type of 'Destination Issue' would solve that problem

Cheers
Sam

Like # people like this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 17, 2022

Thanks for jumping in @Sam Harding !!

@Danilo Simic  - Glad it is working for you!

Suggest an answer

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

Atlassian Community Events