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,456,305
Community Members
 
Community Events
176
Community Groups

Is there a way in automation to count the number of users in a custom field (multi user picker)

Hello JIRA Experts,

 

Just wanna know if there's a way in automation to count the number of users in a multi-user picker (custom field).

 

Thanks,

Ry

 

1 answer

2 votes

Hi Ryan,

I think you should be able to do this with the size function and Smart values. See if the below gets you what you seek.

value = {{issue.customfield_xxxxxx.size}}

Hi @Ryan B_ Gonzales 

Yes, and to Jack's answer: to ensure that count is always a number, you may add a default so NULL is replaced with zero.  For example:

{{issue.customfield_xxxxxx.size|0}}

Kind regards,
Bill

Like Jack Brickey likes this

Hi, @Jack Brickey  and @Bill Sheboy 

 

Thanks for your reply, just want to confirm first if {{issue.customfield_xxxxxx.size}} is working in JIRA software?

 

Tried to test it now, but I got zero results. I am not sure if the suggested size function and smart values is only applicable in JIRA Service Management.

 

Thanks,

Ryan

The size function works for a smart value list in any of the products.  Have you confirmed the smart value name or custom field number is correct?  Perhaps try writing it to the audit log to confirm that.

And if it is not correct, you may find that information using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

This could also be related to the structure/placement of actions within your rule.  Would you please post an image of your complete rule for context?  Thanks!

Hi @Bill Sheboy

 

1. I have this automation when the user transitions the status of the ticket from Requirement Specification to For Approval it counts the number of users from a custom field (multi-user picker) and assigns it to a custom number field.

1.png

2. This is the custom field I've created for the multi-user picker (issue.fields.customfield_10423) and I am assigning its size of it to a custom number field (Approver_count)

2.png

3. Before the transition to For Approval Status, initial value is None

3.png

4. After the transition, the automation status is SUCCESS

4.png

 

5. However, the value of Approver_count field was defaulted to 9999 which means that the automation capture null for the size of Approver(s)field.5.png

Also, I see this site saying that the said size function and smart values are only applicable in JIRA Service Management.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-insight/

Jack Brickey Community Leader Apr 25, 2022

I think that page is about Insight object operations. I believe the "size" operator works for JSW and JWM as well but haven't played with it. I will try to do so today.

Like Ryan B_ Gonzales likes this

Hi, @Jack Brickey 

Just want to check if you already tried it?

Regards,

Ryan

Thanks for the discussion!
How do you think, is it possible to get a list of tasks whose size is >2 for example?
Now I get an error when comparing that this field was not found.

{{issue.customfield_XXXXX.size|0}} > 2 


Custom Smart Value JQL Search: "(3 > 2 and project = test) AND (project in (xxxxx))" - Field '3' does not exist or you do not have permission to view it.

Not that it was very important, but just out of principle, I can’t understand if this is possible without changing the issue itself, mb through variables, or lookup.

Thanks already:) 

Hi @Petr 

With out-of-the-box JQL features, it is not possible to query the number of selections/values in a field that can be interpreted as a list.

Some work-arounds are:

  • for a one-time/few-times approach, export the issues to another tool or spreadsheet, and perform the analysis there
  • using an automation rule, gather issues to check (i.e. scheduled trigger with JQL, branch, or lookup issues), and then check the size in the rule
  • using a custom field and an automation rule, save the number of values selected/included in the custom field, and then you may use standard JQL to query that custom field
  • buy a marketplace addon for JQL which supports this type of query

 

Kind regards,
Bill

Like Petr likes this

Hi @Bill Sheboy 

Yeah, true, It's nearly impossible to lookup via this condition, 

The best way to export to Excel and count up then, or check keys an automation rule, you are right!

Thanks!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events