I would like to search for subordinate tickets using the Lookup issues action and calculate the number of issues with a status of DONE and the number of issues with a status other than done.
Is there a way to use {{lookupIssues}} to display the number with a status of done and the number with a status other than done?
You may use multiple Lookup Issues action calls, with different JQL; or use one call, and list iterators, smart value, list filtering and math expressions to do that:
For some examples...
To get the count of the Done issues, that would be this:
{{#=}}0{{#lookupIssues}}{{#if(equals(status.statusCategory.name,"Done"))}}+1{{/}}{{/}}{{/}}
That works by iterating over the lookup, filtering by status category, adding 1 for each issue found, adding a default value of 0, and summing the results.
To find the not-done ones, wrap the equals() condition with not().
Kind regards,
Bill
Thank you for your reply. It was very helpful.
By the way, I would like you to let me know, but I am having trouble searching for dropdown fields that have dropdowns A, B, and C using the method below.
How can I search for a dropdown field?
{{#=}}0{{#lookupIssues}}{{#if(equals(customfield_10209,"A"))}}+1{{/}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a selection field, there is a value attribute, such as this:
{{issue.mySelectionField.value}}
To confirm you have the correct expression for the counting, please answer:
Is your custom field single selection or multiple selection?
Are you trying to find issues where one of A, B, or C are selected, or all values A, B, and C are selected?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The field is a single selection. This is a question in which one of ABC is selected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As noted, the value attribute may be used for comparison.
What are you trying to do, once each value is detected:
To count issues with a value, this would count the ones set to value "A"
{{#=}}0{{#lookupIssues}}{{#if(equals(customfield_10209.value,"A"))}}+1{{/}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Koutarou,
Yes, you should be able to do that.
Create your rule and add your lookupIssues action. Add your JQL that identifies the Done ones.
Then you can create a variable if you want to go that route which would be the variable name and this code: {{lookupIssues.size|0}}
Then you use the variable name for updating a field, or include in an email, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would like to search once as below.
"Parent Link" = {{issue.key}}
Is it possible to identify them using {{lookupIssues}}?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it would look something like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to search using only the search below?
"Parent Link" = {{issue.key}}
I would like to search only once and use {{lookupIssues}}.
I would like to know how to use the following correctly.
{{#if(lookupIssues.status.name.eq(dode))}}
{{lookupIssues.size|0}}
{{/}}
{{#if(not(lookupIssues.status.name.eq(done)))}}
{{lookupIssues.size|0}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Searches take a long time and lock automation rules.
So I only want to search once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are getting Done and Not Done counts, it will have to search twice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.