Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Query multiple groups when the users are only part of one group

Ian Templeton
Contributor
December 13, 2024

We have a support team that has a variety of different types of employees i.e. (FTE, CSG, Intern, etc.) so we frequently query using memberOf() to see which employee type did what. 

I want to query for CSG and Interns excluding the FTE and other groups. While the following works, is there a cleaner way to write the query to pull member of both groups? Note, the members are only part of one group.

 

project = "Our Project"

AND "Assigned Team" = Doers

AND priority in ("Priority 1", "Priority 2")

AND assignee in membersOf("CSG")

OR project = "Our Project"

AND "Assigned Team" = Doers

AND priority in ("Priority 1", "Priority 2")

AND assignee in membersOf("Intern")

 

Thanks in advance!
~Ian

1 answer

1 accepted

2 votes
Answer accepted
Walter Buggenhout
Community Champion
December 14, 2024

Hi @Ian Templeton,

You could indeed shorten your query by removing quite some duplication in there like this:

Project = "Our Project" AND "Assigned Team" = Doers AND
Priority in ("Priority 1", "Priority 2") AND
(assignee in membersOf("CSG") OR assignee in membersOf("Intern"))

Hope this helps! 

Ian Templeton
Contributor
December 16, 2024

Thank you for the suggestion @Walter Buggenhout!

Unfortunately, that doesn't work as the OR pulls in items for the group members from other projects, statuses, priorities, etc. outside what's scoped for the first group. 

Walter Buggenhout
Community Champion
December 16, 2024

That surprises me, as that's what the extra parentheses around the assignee part are there to prevent from happening:

(assignee in membersOf("CSG") OR assignee in membersOf("Intern"))

 

Like Laurie Sciutti likes this
Ian Templeton
Contributor
December 16, 2024

Thanks for following up @Walter Buggenhout!

Full transparency, I missed the extra parentheses around the assignee part, which does work when included. Thank you!!!

Like Walter Buggenhout likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events