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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,462,882
Community Members
 
Community Events
176
Community Groups

Automation for Jira Can Take a Long Time to Link Issues

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 Mar 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.

Here's the rule.

screenshot-1.png

Mark Segall Community Leader Mar 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

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.

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

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.

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!

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

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

Atlassian Community Events