Forums

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

JQL for querying users not in a group

Patrick Van Tassell October 5, 2021

Hello all, 

I am trying to find a query for all tickets that have been assigned to a group, but not someone in that group. 

Finding the opposite of "membersof" seems to be the issue here.  I have tried numerous placements of not and ! and have not been able to find a solution.

Something like the following, but "not" is where the query fails: 

assignee changed by not membersof("DevOps Team")to membersof("DevOps Team")

 Thanks in advance!

1 answer

1 accepted

4 votes
Answer accepted
Ivan Lima
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2021

Hi @Patrick Van Tassell, you mentioned a few different pieces in your question, so I'll try to break those down into separate parts.

Find issues where assignees are not a member of a particular group. You can look at the membersOf function to get additional insights.

assignee not in membersOf("DevOps Team")

Find issues where the assignee was changed by a user who is a member of a particular group. Note that the previous assignees, and the current one, don't necessarily need to be the user who changed the assignee field.

assignee changed by membersOf("DevOps Team")

You can do the opposite by adding NOT at the beginning of the statement. In this case, you will get all issues except the ones where the assignee was changed by a user who is a member of a particular group.

NOT (assignee changed by membersOf("DevOps Team"))

I hope that all make sense.

Patrick Van Tassell October 6, 2021

Ivan, thank you for your detailed response.  I think the last example is the answer I was looking for. 

Patrick Van Tassell October 6, 2021

Hi Ivan, 

After digging into it more, I am still having a bit of an issue.  

To give full context, I am trying to see when tickets are assigned to the group "DevOps Team" from people not within the group within a set amount of time (last 7 days in this example.  

I have come up with the following query based on your answer: 

not (assignee changed by membersOf("Devops Team")) TO membersOf("Devops Team") after -7d AND project = devops AND resolution = unresolved

This query is giving me a checkbox showing it has no errors but still fails with the following error: 

"Error in the JQL Query: Expecting either 'OR' or 'AND' but got 'TO'. (line 1, character 52)"

Ivan Lima
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2021

Try this:

(assignee changed to membersOf("Devops Team") after -7d) AND (NOT assignee changed by membersOf("Devops Team")) AND project = DEVOPS AND resolution = Unresolved
Like Patrick Van Tassell likes this
Patrick Van Tassell October 7, 2021

That's definitely done it!  You're awesome, thanks again!  

Like Ivan Lima likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events