Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,197
Community Members
 
Community Events
168
Community Groups

Update custom field when ticket is linked

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 Aug 11, 2022

Hi Danilo,

Can you share the actual automation rule with us? 

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

 

1.PNG

John Funk Community Leader Aug 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? 

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 Aug 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

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 Aug 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 Aug 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
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,012 views 18 31
Read article

Atlassian Community Events