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
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}}
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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)
3. Before the transition to For Approval Status, initial value is None
4. After the transition, the automation status is SUCCESS
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Petr AST
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:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also have trouble with this. {{issue.customfield_xxxxxx.size}} doesn't return anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As this is a very old thread, please create a new question using the "Ask a question" link at the top of the page.
When you create your question, please note context is important for the community to help. Please post the following in your new question:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey! I managed to resolve this. I was using a wrong custom field. Thank you for your suggestion!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this also possible with a scripted field using Scriptrunner? To count the number of users in a multi user-picker field, and also return 0 if none?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there any way to count the tickets when they are created?
Fox example:
I create the ticket MAR-1 and the customefield correlative = 1
I create the ticket MAR-2 and the customefield correlative = 2
....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For this I have the customefield = Correlative and this field is a number field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This seems to be a duplicate of your other question. Please look there for responses: https://community.atlassian.com/t5/Jira-Software-questions/Count-Issue-Types/qaq-p/2337031
Thanks, and kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.