It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner enhanced search negate query

Ashwin Balakrishnan Apr 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
Payne Seal Community Leader Apr 22, 2019

Try issueFunction not in, i.e.

 issueFunction not in linkedIssuesOf("project = xxx") 

0 votes
Ashwin Balakrishnan Apr 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 Seal Community Leader Apr 22, 2019 • edited

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
Kristian Walker Community Leader Apr 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 Seal Community Leader Apr 24, 2019 • edited

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 Community Leader Apr 24, 2019 • edited

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 Seal Community Leader Apr 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 Apr 24, 2019

I am using cloud

Ashwin Balakrishnan Apr 24, 2019

not issueFunction in linkedIssuesOf  

perfectly works. Thanks Kristian

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Marketplace Apps & Integrations

Demo Den Ep. 4: Continuous Integration with CircleCI & Jira Software

Get ready! Demo Den Episode 4 is coming your way on Tuesday, May 28, 2018 with a Continuous Integration and Delivery special demo. CircleCI Director of Solutions Engineering, Eddie Webb will show us ...

594 views 0 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you