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

Automation for Jira Can Take a Long Time to Link Issues

Jeff Gordon March 15, 2022

I have implemented a rule such that when an issue of a certain type is created in a single project I run a JQL to find other issues in the project created by the same reporter within the last twelve weeks.  Everything works correctly but it takes a really long time to run.  I.e., one run took 30 minutes to link 35 issues.  It even takes 15-30 seconds to link 4-5 issues.  The net result is the rule quickly becomes throttled due to exceeding its 12 hour allotment (I know I can increase this but...).

I know the JQL takes less than a second so I don't think that's the problem.  It's definitely related to how many issues will be linked.

Anyone have any similar experience or ideas on this?

1 answer

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2022

Hi @Jeff Gordon and welcome to the community!

Can you share a screenshot of your rule?  That would help identify whether there are any opportunities for optimization.

Jeff Gordon March 15, 2022

Here's the rule.

screenshot-1.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2022

Thank you @Jeff Gordon

Your rule seems pretty straightforward to me.  However, is it correct to assume that you're using Jira Server?  If so, there could be any number of environmental factors that could be playing into your execution times (CPU, RAM, etc.).  I would check with your Ops team to make sure that they're not shorting Jira on resources.

Like Stefan Salzl likes this
Jeff Gordon March 15, 2022

Jira Data Center.

I've switched to using a scriptrunner script as it's able to link the same number of issues in about 15% of the 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.
March 15, 2022

Hi @Jeff Gordon 

Very curious symptom...

Why do you believe the JQL is executing in less than a second for that branch?

How many issues is this rule trying to link, and is the number what you expected?

Kind regards,
Bill

Jeff Gordon March 16, 2022

I can execute the JQL in issue navigator with a given reporter and it's always very quick returning results.

It can link anywhere from 1 to 41 (most I saw). The time seems to grow exponentially with number of issues being linked.

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.
March 16, 2022

Thanks, Jeff. 

The comparison of the JQL performance with defined values for key and reporter versus the dynamic lookups may not be equivalent.  

Would you please post the complete JQL used in that branch and an image of the branch component details in the rule?

Also, would you please post an image of the audit log details showing an execution that took 30 minutes to link 35 issues?  That may show something to indicate what is happening.  Thanks, again!

Jeff Gordon March 17, 2022

JQL:

project = TechLounge and key != {{issue.key}} and issuetype in ("Service Request", "Problem") and reporter = {{issue.reporter}} and ( created >= -12w or status not in (Closed,Complete,Completed,Resolved,Done))

Branch Rule:

image-2022-03-17-13-49-29-797.png

Audit Log:

image-2022-03-17-13-53-55-550.png

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.
March 17, 2022

Thanks, Jeff.  I have observed JQL runs slower with negative conditions, so I wonder if you invert the status test to be positive what will happen to performance.  For example:

... status IN (all possible other status values) )

or if I am interpreting your query correctly

...statusCategory = "In Progress" )

Also, what is the significance of the test for created >= -12w?  Is that to link all frequent reports from a specific reporter?  If that is not needed, you could remove the entire OR clause, and that probably will speed things up a bit.

JQL is not a SQL, so we are guessing without testing what happens to performance.  :^)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events