Scriptrunner enhanced search negate query

Ashwin Balakrishnan April 20, 2019

Hi,

 

I am using the following query to show projects that has links.

 issueFunction in linkedIssuesOf("project = xxx") 

What should i do to get the negate of this query, meaning, I want to list all jira issues which doesnt have a link to project xxx. I tried the following but scriptrunner doesnt like the syntax

 NOT (issueFunction in linkedIssuesOf("project = xxx"))

or

!( issueFunction in linkedIssuesOf("project = xxx"))

 

3 answers

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2019

Hi Ashwin,

Thank you for your question.

I can confirm that calling not in on issue function is invalid as the issueFunction in linkedIssuesOf() function is protected as this is required to invoke the enhanced search mechanism that the JQL provides.

This means that you need to leave the function call as it is and place the not keyword before the call is made in order to retrieve the inverse results from the search.

This means that your example query above should be structured to use the syntax shown below.

not issueFunction in linkedIssuesOf(<SubQueryHere>)

I can confirm that you can see more detailed information on how the Enhanced Search functions work inside of Jira Cloud in the documentation page located here.    

You can also see more details on the differences between the cloud and server versions of the add-on in the documentation page located here

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,

Kristian

Payne
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 24, 2019

No, "not in" is perfectly valid (at least in Jira Server). But, so is "not issueFunction ..."

These two queries produce the exact same result set:

issueFunction not in linkedIssuesOf("project = BR")

not issueFunction in linkedIssuesOf("project = BR")

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 24, 2019

Hi Payne,

I can confirm that not in is valid inside of Jira Server but inside of Jira Cloud the ScriptRunner search functions work differently and must be run on the Enhanced Search page due to the fact that we run the queries in a sandbox environment due to the restricted nature of Jira Cloud. 

The Enhanced Search functionality works as mentioned in my previous reply and does not support using issueFunction not in like you can do in Jira Server. 

Regards,

Kristian

Payne
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 24, 2019

Gotcha; thanks for clarifying. Ashwin didn't state whether he's running Server or Cloud, but it may well be Cloud.

Ashwin Balakrishnan April 24, 2019

I am using cloud

Ashwin Balakrishnan April 24, 2019

not issueFunction in linkedIssuesOf  

perfectly works. Thanks Kristian

0 votes
Ashwin Balakrishnan April 22, 2019

This is what i get when I use  (i replaced xxx with correct project name)

issueFunction not in linkedIssuesOf("project = xxx") 

 

image.png

Payne
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 22, 2019

That looks different than my search screen on Jira Server. Are you running Jira Cloud? Or are you on a different screen?

jira.jpg

0 votes
Payne
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 22, 2019

Try issueFunction not in, i.e.

 issueFunction not in linkedIssuesOf("project = xxx") 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events