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.
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.