Script Runner: how find issues that don't have something

Mikhail Cherkasov June 15, 2014

Hi all,

https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-linkedIssuesOf(Subquery,linkname)

I need to find issues that don't have backports, but have a special label, so how to explain *has not*?

issueFunction in linkedIssuesOf("type = Backport") and labels in ("special_label")

the query above will query issues that *have* bacports, but I need to query issues that has *not* backports.

3 answers

1 accepted

0 votes
Answer accepted
Svante Gustafsson Björkegren
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 15, 2014

Hi Mikhail,

You could try:

labels in ("special_label") AND NOT issueFunction in linkedIssuesOf("<some sub-query>", "Backport")

Should work according to the Script Runner docs

Cheers,

// Svante

Svante Gustafsson Björkegren
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 15, 2014

This will result in the same set of issues as Jochen suggest. The placement of the NOT clause is not important in this case.

You will get all issues with the special label AND issue link != Backport (which means all issues with no link at all as well)

Svante Gustafsson Björkegren
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 15, 2014

This will result in the same set of issues as Vijay suggest. The placement of the NOT clause is not important in this case.

You will get all issues with the special label AND issue link != Backport (which means all issues with no link at all as well)

0 votes
JK
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 15, 2014

Basically I am with Vijay, but I think the query would be something like

issueFunction NOT in linkedIssuesOf("type = Backport") and labels in ("special_label")

Maybe you have to add more criteria like project or issuetype to find your issues as NOT IN finds EVERY issue not having that specified kind of link.

0 votes
Vijay Khacharia
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 15, 2014

Hi Mikhail,

Did you try to put NOT in the front of the query?

NOT(issueFunction in linkedIssuesOf("type = Backport") and labels in ("special_label"))

Vijay

Suggest an answer

Log in or Sign up to answer