So my problem is this:
I want to know how many "eng feedback" subtasks QA has made per parent ticket when the parent is in X status.
Is this possible with using JQL and not a tool like script runner?
Any help would be appreciated
With JQL, you need to either have a field value to refer to, or have a JQL function which references the required need.
You can do this with a field value in Jira Cloud without an app, although it will required a custom field and an automation rule.
You'll need to be a Jira Admin for this.
I'd either not have this field on a screen, or only add it to a View screen (via Screen Scheme operations). You don't want this to be manually editable from an issue's view.
^ This will then count the number of sub-tasks below an issue when transitioned to the appropriate status. You can then reference it in JQL like any other number field.
Remember with global automation rules there is an execution limit per month, which is different depending on which plan you're on. Project executions however are almost unlimited.
@Stephen Wright _Elabor8_ idea of using automation and the issue.subtasks.size is a great solution.
But, IMO, it needs to be tweaked as follows:
1. The trigger for the automation should not be 'issue transitioned', as adding sub-tasks can happen at any time and is neither considered a workflow transition nor related to any transition.
Instead, the trigger should be either the 'issue updated' event, or a schedule (run every N minutes/hours/etc.).
2. Then you add a condition that the issue is in status X, and only then you update the custom field.
One more minor tweak: while a number field is the correct field type, Jira treats number fields as floating point and will display the value as 2.0.
So I would choose instead a short text field which Jira does not format in any way.
Some good ideas above!
The rule could be tweaked depending on the scenario, the original answer was specific to the question - but alternatives should be tested, to ensure it works from each different user's need.
I would recommend being careful with the Issue Updated trigger though - especially if this is a global rule. Free/Standard plans only get a certain number of global executions per month - and an Issue Updated trigger is going to activate a lot.
Good point! In our Jira, all the automations are per project and not global, and each has very specific conditions.
So I wonder about this "global execution" - is this counting the number of times the automation was invoked or only the cases where the actions were performed after the "if" clause in it was true?
An execution is counted if the rule is triggered - regardless if an action is taken or not.
That's why for global rules I'd recommend using triggers which are more specific, or which are controlled - such as...
...rather than Issue Updated, etc - which can trigger a lot.
If you do need a number of global rules, I'd also consider if having a Premium or Enterprise plan is best - due to the number of global executions you get:
Hi @Phillip Talbot ,
You can use the Enhancer Plugin for Jira for this.
It has a custom field called Status Counter that does the exactly what you're asking for: Counts the number of times the issue is in that particular status.
This custom field can be used to sort or search in issue navigator.
Enhancer Plugin for Jira has many more custom field types that can fit your different requirements.
Please let me know if you have further questions.
Please note that I'm one of the members of the Snapbytes team.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events