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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I have a custom field (customField) where the user can select multiple values (value1, value2, value3). I further have two tasks with that custom field:
and a Jira query containing
The semantics of the equals operator in the Advanced search reference page is described as
=
" operator is used to search for issues where the value of the specified field exactly matches the specified value.My expected result for this query was therefore only {Task 1}, but Jira actually delivers both {Task1, Task2}. The equals operator in this case appears to be more of a set inclusion test than a set match.
Questions
Thanks!
I'm not sure why you would think this. The equals value is not a set inclusion, you're doing that with the set you defined in the values.
Equals means equals. Does this issue have value X? If you define X as a set, then obviously it could match several times. = means "or" in boolean logic.
To do your "exact match", you will need to exclude. Jira doesn't have an XOR function, so you'll have to do it manually. "field = X and field not in (y, z)"
Thanks for the fast response!
To me a multi-select field is a representation of a set. Assume a multi-select team field, where I can select zero or more teams. Say I have defined the multi-select myTeam field as having teams Red, Green, and Blue.
Then in an edit dialog I can select any one of the following team combinations
This, to me, is a set (I can select any subset of the three values).
If I now use equals to test for Red, i.e. "myTeam = Red", a Jira search will yield all issues which have any one of the following sets as value of the myTeam field:
and not just issues with the field set to Red (and only Red) which I would expect from the equals operator which Atlassian defines as
=
" operator is used to search for issues where the value of the specified field exactly matches the specified value.If for an issue I choose all 3 teams, then the value of the myTeam field in that issue would be Red, Green, Blue. And to me, the value Red is not the same as the value Red, Green, Blue.
You state above that equals means "Does this issue have value X" which to me is testing whether value X is a member of the set.
Thanks for answering the "exact match" question, which for the example above would be
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's my point, the = operator has exactly matched it, the field contains that option. The fact that the field may contain other options is irrelevant to =.
If you wanted an "exact match on all content", then you would need a way to enter an array of options in JQL, and to use == instead of =. You'd also need to get the array in the right order, the order in which the options happen to be stored in the field. Not a lot of us have much use for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just stumbled upon this question and I have the same question but about the full set. I get the way to sort out those values where only "Red" is selected but is it at all possible to make a query that returns issues where only "Red, Green, Blue" is selected? not any other combination of subset?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you can use the AND operator to join clauses.
Team = Red and team = green and team = blue
will satisfy that particular query, although you will need to add more if you mean "only when an issue has red green and blue"
That query will return issues that have (say) red, green, blue and yellow set. You'd need to add "and team != yellow" to my first query to drop those issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, thank you! but if i want to exclude those issues that have only red and green and not blue, it seems more difficult.
The reason is to make bulk changes on that particular field, e.g. :
issue 1-50: red, green, blue
issue 51-100: red, green
If I want to add a new team, yellow, but only to issue 1-50, it seems difficult to filter out those issues.
I guess I could check-box my way through a list of just 100 issues but more than that its starting to become a pain...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's two parts to this.
"colour = red and colour = green and colour =blue" will return issues 1-50, it will ignore 51-100. So you can use that to do bulk-edit and add yellow to them.
The other part is a place for the "not" operator; If you ran a filter for "colour = red and colour = green and colour !=blue", then you would get issues 51-100 only!
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.