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,560,552
Community Members
 
Community Events
185
Community Groups

How to get the sum of tickets in a filter per priority Smart Values

I'm trying to figure out which smart values I can use to get the # of tickets in a certain filter that have priority low, medium, high. 

In the atlassian documentation it says this is possible with the ".size" but I can't get that to work. 

These smart value keep returning 0. Any ideas? Screen Shot 2022-09-26 at 11.27.51 AM.png

2 answers

1 accepted

4 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.
Sep 26, 2022

Hi @Julia 

First, a disclaimer: I am using Jira Cloud and not Server / Data Center, so I cannot verify this suggestion.

Your Jira version has bulk operations on {{issues}} for a branch or scheduled trigger, and I believe this will work, where you may change the priority names for your own:

{{issues.priority.name.match("(Highest)").split(",").size|0}}

What this is doing is...

  • grab the list of the priority names from all of your issues
  • use a regular expression to match() on the name...producing 0-to-many values in a comma-separated values list
  • split that into a smart value list
  • count the items with size
  • and add a default value of zero in case nothing was found

Kind regards,
Bill

This worked thank you so much! 

Like # people like this
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.
Sep 27, 2022

I am glad to learn that worked for you!  The same technique works for Jira Cloud with Lookup Issues, and it is quite handy for reporting emails send by automation.

Like John Funk likes this
0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 26, 2022

Hello @Julia 

Can you provide the full content of your automation rule, and a link to the document you are referencing when you get information about ".size"? That will help us provide answers relevant to your context.

The "size" property is relevant to have a list of items. There may be other ways to handle this but I would try using the Lookup Issue action to get a list of issues in a given priority and then use {{lookupIssues.size}} to get the number of issues in that list. If you are trying to get the counts for multiple lists into another single action (like Send Mail) you would need to assign the {{lookupIssues.size}} value for each Lookup Issues action to a separate variable, I think, as each LookupIssues action would overwrite the results of the previous action.

https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html 

 

The entire context is this:

  • Scheduled Trigger to run Daily with JQL being a certain filter 
  • Send an email with the sum of the # of tickets within that filter by each priority
    • i.e. how many are low, medium, high 

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 26, 2022

Thank you for that additional information.

In this scenario you can't use "size" to get a count of a subset of the issues returned by your JQL. You can get a count of all the issues returned by the JQL or a count of the Comments associated to an issue in the list, but not a count of a subset of issues in the results.

You could create multiple scheduled rules, each with a JQL that retrieves the issues for a specific priority, and use {{issues.size}} in a Send Mail action to get the count for issues for that one priority.

Alternately you can do as I suggested before and create multiple Lookup Issues actions, each with a JQL that gets issues for one priority, and collect the size of each result set in a unique variable. Then include all those variables in your Send Mail action. In that scenario you would not have the JQL as part of the Trigger.

Is your solution possible on Jira Server? I think that may be only available for cloud?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 26, 2022

Oh, I apologize. I did not notice that your post was tagged for Jira Server. The Lookup Issues action is not available there, but there is a change request for it.

https://jira.atlassian.com/browse/JIRAAUTOSERVER-53

I think then in your scenario you would need to run the JQL per priority in separate rules.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events