Jira Automation - Tigger "Create or Update" option?

Sion Dinh April 22, 2022

Hello!

 

I would like to know if a trigger exist which includes BOTH 'Create or update issue'.

 

So it will trigger if a subtask is created, OR if a subtask is updated? Right now I have to maintain 2 sets for automations for both scenarios!

 

Thanks

3 answers

1 vote
Bill Sheboy
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.
April 22, 2022

Hi @Sion Dinh 

No, there is no such trigger for automation rules.

If your rule maintenance is cumbersome, consider creating three rules:

  1. Trigger on Create Issue, and make an update which can trigger rule #3
  2. Trigger on Update Issue, and make an update which can trigger rule #3
  3. Trigger on the condition created by rules #1 and 2, and perform the work necessary for both.  For this rule to be triggered by other rules enable the "Allow Rule Trigger" option in the details.

Kind regards,
Bill

Sion Dinh April 25, 2022

Thanks Bill! Will give this a try!

Like Bill Sheboy likes this
0 votes
danielcsant February 21, 2024

Hi @Sion Dinh 

You can use the Multiple issue events trigger for that.

2024-02-21 15_44_01-Window.png

Kind regards,

Daniel

0 votes
Krzysztof Achinger May 18, 2023

I stumbled upon similar problem where I wanted to run trigger Field value changed and then in subsequent if/else conditions check for whether the change in field value was during issue creation or update. I solved it by comparing dates for issue created vs. now. This could help in your use case @Sion Dinh.

 

This condition will run when change was made during issue creation:

Screenshot 2023-05-18 at 17.17.12.png

 

You can verify that by logging action:

Screenshot 2023-05-18 at 17.17.25.png

 

Note: the solution does not guarantee 100% accuracy. If Jira slows down for some reason and fires the automation rule more than a second after issue was created, it may fail. So to prevent that you can further consider comparing the two timestamps (now and created) by calculating the difference between them and setting acceptable delay, e.g. 5000 milliseconds (5 seconds). Use {{[date1].diff([date2]).[unit]}} to do that. More documentation here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Bill Sheboy
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.
May 19, 2023

Hi @Krzysztof Achinger 

Such a rule could also run into problems when the automation engine is impacted, such as by an outage.  In this case, some rules will run at an indeterminate time in the future and some will not run at all.  (This has been confirmed by Atlassian staff in other community posts.)  There really is no way to know/guarantee when a rule will run, and so relying on {{now}} to decide if a create or update happened could be problematic.

Kind regards,
Bill

Krzysztof Achinger May 19, 2023

Indeed, that is what I described in a "note" after screenshots.

Suggest an answer

Log in or Sign up to answer