Can you use JQL on a User Picker (multiple users) custom field to query by number?

I have a custom field in JIRA of type "User Picker (multiple users)". Let's call it Approvers. 

I'd like to write some JQL like "Approvers" > 3, but JIRA is unhappy about that saying "The operator '>' is not supported by the 'Approvers' field.".

Is this even possible?

Thanks!

2 answers

1 vote

That's because "approvers" is a list of users.  The question you're asking if translated into plain English is "Are Dave, Alice and Bob greater than three?".  Which is not a valid question.

You will need to set up a sensible question - either create a JQL function that will count up the number when given a field name, or a custom scripted field that can add it up.  Either way, you'll need an add-on of some sort to provide the code to do this.

0 vote

In case others run into the same problem, I wound up using automation to solve my problem.

Specifically, I wound up creating a hidden number field, that when the "User Picker (multiple users)" field was updated, it would use issue.field.customfield_1234.size to update the count of the hidden number field.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

13,142 views 15 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you