JQL: query issues where assignee != project lead; or where assignee != reporter

Derek MacNeil June 22, 2012

I'm looking to create a filter where issues are not assigned to the project lead. Another way this could work is if the current assignee is not the same as the reporter:

- project = 'my project' and assignee != reporter

- project = 'my project' and assignee != projectlead()

Something along those lines. Any suggestions?

4 answers

0 votes
Filipe February 25, 2014

Hi,

You can give a try on:

https://marketplace.atlassian.com/plugins/pt.lt.lfcribeiro.jira.jqlLTFunctions

It lets you run SQL staments in a JQL functions(executeQuery() )

Thx

0 votes
Nancy Blackwell
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.
December 29, 2013

Scripted field doesn't work because the scripted field is not rendered until the browser displays the issue (I think). Our solution was to have a number field set to -1 on create, then when we assign the issue back to the requester, we set it to 0. Then the number field is searchable. Note: This only works if you know when you are setting it back to the requester through post functions.

JamieA
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.
April 16, 2014

Scripted field will work fine providing you set an indexer. Better to use a jql function though.

0 votes
Norman Abramovitz
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.
June 23, 2012

I do not know how many project leads you have per project but if your environment is simple(ie small number of project leads) then you could create groups for each project containing the project leads and then use the membersOf function like:

assignee not in membersOf("projectx-project-leads")

Norman Abramovitz
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.
June 23, 2012

Again, if the number of project leads is small, you could just list them like

assignee not in ( name1, name2 )

0 votes
Dieter
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.
June 22, 2012
Such queries that do not work out of the box can be implemented using a scripted custom field which returns 1 if a certain condition holds. More information about how to create scripted custom fields can be found here: https://studio.plugins.atlassian.com/wiki/display/GRV/Scripted+Fields

For the first query you should create a scripted field, e.g. scriptedfield1 which returns "1" if the assignee equals the reporter else it returns "0"

Then you could use

project = 'my project' and scriptedfield1 != "1"
Similar can be done for project lead

Suggest an answer

Log in or Sign up to answer