You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
trying to take a field that has a list of customers and be able to query for only issues where the number of customers is greater than 1. The field will also have null values at times
Try using multiuser picker field to store list of customers and calculated field (provided by ScriptRunner) with this script to store it count
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.fields.CustomField /** * Get number of users for multiuser picker */ CustomField multiuserCstFld = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("FieldName") if (multiuserCstFld == null) return "custom field not found" return "" + ((ArrayList) multiuserCstFld.getValue(issue)).size()
I've tried this on the 'Components' field and receive an error:
"custom field not found"
Does this not work on OOTB fields?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Components is not a custom field.
You should method of Issue class use https://docs.atlassian.com/software/jira/docs/api/7.1.2/com/atlassian/jira/issue/Issue.html#getComponents--
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.
So what would this look like in order to have a field that showed the number of components? Since it's not a custom field?
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.