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}}
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
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.
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 @Jack Brickey
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
....
For this I have the customefield = Correlative and this field is a number field
Hi @Marcelo Ignacio Cid Abud
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
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?
I also have trouble with this. {{issue.customfield_xxxxxx.size}} doesn't return anything.
Hi @Aleksandra Leesment
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:
Hey! I managed to resolve this. I was using a wrong custom field. Thank you for your suggestion!
It looks like you're new here. Sign in or register to get started.