Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation Rule - Long Execution time - any way to optimize?

Krzysztof Kiser
Contributor
January 27, 2021

Hi,

I have setup up Jira Automation to perform some changes on issues when I schedule them to be assigned on a certain date.
I've created the below rules for (create and edit issue).
The rule performs all the tasks correctly, but it takes anywhere from 45s to 1m to complete.

It is a little long and I was wondering if you guys had any ideas on how I could optimize this rule?

I tried merging the JQL with the Stats condition into one JQL, but that didn't help at all. I really don't know what else I could change to make this rule execution time faster.

I would appreciate any suggestions :)

 

Screen Shot 2021-01-27 at 9.12.58 PM.pngScreen Shot 2021-01-27 at 9.13.20 PM.pngScreen Shot 2021-01-27 at 9.13.37 PM.pngScreen Shot 2021-01-27 at 9.13.49 PM.png

 

3 answers

2 accepted

0 votes
Answer accepted
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.
January 27, 2021

Hi @Krzysztof Kiser 

I am wondering if the outer JQL branches and repeated duplicate JQL conditions are the largest time sinks.

You could try substituting with a single, common condition test earlier and then use If/Else Condition for the variation parts, inverting the branches to simulate nested if/else last.  That would defer what appear to be the most expensive operations: branching.  Here is the information from Code Barrel (now part of Atlassian) on that idea: How to Optimize Your Automation Rules...

  • Trigger: value changes for Scheduled Assign Date
  • Condition: if resolution is Null
  • Condition (if/else): if Scheduled Assign Date > startofday()
    • Branch: JQL status not in Scheduled
      • Action: transition to scheduled
      • Action: edit assignee
      • Action: add comment
    • Branch: JQL status... and so forth
      • ...
  • Condition: else if Scheduled Assign Date <= startofday()
    • and so on

With asychronous rule processing, logging time at certain points may not tell you much.  So you may need to clone your rules to test versions.  (Unfortunately, there is no version control of rules to revert to an earlier version.)

Maybe also check the rules performance insights (under the ... in the rules list) to see if any throttling is happening.

Best regards,

Bill

Krzysztof Kiser
Contributor
January 27, 2021

@Bill Sheboyand @Jack Brickey  - thanks for all your suggestions.

I just restarted Jira and surprisingly long execution times are no longer an issue.

Hopefully it will stay that way. If not I will try to follow @Bill Sheboy advice.

 

Thank you again!

Like Bill Sheboy likes this
0 votes
Answer accepted
Jack Brickey
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 27, 2021

i'm not sure this will improve 'total time to complete' but at a quick glance I would consider breaking this down into smaller rules if possible as it helps w/ rule performance.

Krzysztof Kiser
Contributor
January 27, 2021

@Jack Brickey, thanks for the suggestion. I did split the rule into 4 separate ones to test performance, but it didn't really help. It took 40s to execute the below one. I think it's the transition and I will need to look into that to see if I can make any changes in the workflow.
I have some more extensive rules in my Jira and they are completing within a few seconds, so it must the transition.

Screen Shot 2021-01-27 at 9.45.53 PM.png

Jack Brickey
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 27, 2021

i wonder about using the "Add value to audit log" action to help see where time is being spent. I use this for my debugging. Unsure but would home a timestamp could be leveraged.

Like Hana Kučerová likes this
Krzysztof Kiser
Contributor
January 27, 2021

@Jack Brickey I tested the workflow and it looks like that is not the problem. I am using JMWE "Return to previous status" on one of the transitions and I thought this was taking so much time, but I just tested this transition manually and it's pretty much instant.

0 votes
Salim Hammar
Contributor
April 11, 2022

Hi @Krzysztof Kiser 

 

I have the same problems , i have a rule , but it takes from between 40s and 70s to complet and i noticed when i cancelled this rule after launch the rule the execution takes place anyway

 

Have you fin a solution for your issue ? Have you idea ?

 

Thanks in advance

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

Hi @Salim Hammar 

As your automation rule is different for your case, I suggest you:

  • create a new question,
  • include images of your rule and the audit log details,
  • describe your Jira instance and project type,
  • describe what you are observing, and
  • link to this thread to request ideas from the community.

Creating a new question is a better way to get the most people to see it rather than adding to an older thread...where only the original contributors/watchers will notice it.  Thanks!

Kind regards,
Bill

Salim Hammar
Contributor
April 20, 2022

Hi @Bill Sheboy 

 

Always the same problem, i'm try the creat a new rule in the new project ,create a rule simple but always nothing

 

Thanks in advance

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 20, 2022

@Salim Hammar ,

please post a new question with the necessary details.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer