Jira Automation - Can't reliebly update a field based on trigger

EdgeSync January 25, 2023

Hi,

Was wondering if anyone had some ideas on this.

I have a workflow I'm trying to automate, but hitting some problems with getting it to consistently work.

  1. Issue Created, custom field "Name" has a value "foo"
  2. Do JQL to find any issues in this project which also have "Name" ~ "foo"
  3. Link the Created issue with all the issues found in JQL query
  4. Each time an issue is linked, update a custom field "Count of Related Tickets" by +1

I have tried two different ways to do it


First Attempt:

Selection_191.png

 

This increments the "Count of Related Tickets" on the linked issues, not the trigger issue (the newly created issue). I need to update the Trigger issue, not the linked issue.

 

Second Attempt:

This has 2 rules that work off each other.

First rule, links the related issues:

Selection_192.png

And the second rule does the increment based off the trigger "When issue linked"

Selection_193.png

But this doesn't work consistently either. It works fine for 1 or 2 linked issues, but if there are 5+ it will not update the number correctly. For example 11 linked cases, then the value should be 11, but the field only gets updated to anywhere between 3 and 8. I can see in the audit log that the Edit Issue Field is all happening more or less at the same time, so it is not always pulling the most recent value. Even adding in the re-fetch issue data doesn't help. I believe the problem is the asyncronous nature of jira updates. If there was some way to make them go FIFO that would be amazing.

Any ideas on what I can do to make this work, or maybe an easier way to do it?

Thanks!

 

 

3 answers

0 votes
Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2023

Hi @EdgeSync

For your second automation rule where you have the trigger as 'Issue linked', was the option 

Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.

checked?  This will show up if you click on 'Rule details' and in the right side panel.

Hope this helps.

Thanks,
Vamsi

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 31, 2023

One thing you could consider is rather than trying to increment the field with each link event, in your first rule add Actions after the branch to retrieve the linked issues (use a Lookup Issues action to retrieve them) and set the field to the number of issues retrieved.

0 votes
EdgeSync January 31, 2023

bump - still looking to get an answer on this - if anyone can help :)

Suggest an answer

Log in or Sign up to answer