!= operator seems to be not working with issueLinkType

Christian Wietholt February 2, 2021

I am trying to find all issues that do not have a test linked to it. I created an issueLinkType "Testers", with the two options "tests" and "is tested by". Now I would like to find any issues in Jira that do not have a test linked to it. My JQL search query looks like this: 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) AND issueLinkType != Testers ORDER BY created DESC

This query consistently comes up with nothing, although I know that I have some issues within my search that don't have an "Testers" linked to them, and others that do have "Testers" linked to them. 

Performing the reverse search works as expected: 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) AND issueLinkType = Testers ORDER BY created DESC

This comes up with a subset of issues that do have tests linked to it.

And if remove the issueLinkType completely: 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) ORDER BY created DESC

I see all the expect issues in my list, with and without "Testers" linked to them. Thus, I am expecting with the initial query to find only issues that have not tests linked to them. Am I doing anything wrong, or did I run into a bug? 

 

3 answers

2 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2021

Building on what @Kian Stack Mumo Systems said, when you add the issueLinkType criteria using either != or = or in, the query will look only at the issues that have at least one linked issue. For an issue that has no links, the query has nothing to compare to for checking if issueLinkType is or is not "Tester". You have to use the "is EMPTY" option if you want your results to also include issues that have no issue links.

Christian Wietholt February 3, 2021

Thanks for explaining the reasoning behind it. I had thought that something like this might be the case, but this wasn't really clear from the documentation. In addition, I apparently didn't use the "EMPTY" value correctly before. 

2 votes
Answer accepted
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 2, 2021

Try the following:

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) AND (issueLinkType != Testers or issueLinkType is EMPTY) ORDER BY created DESC
Christian Wietholt February 3, 2021

Thank you very much for the very quick help. This seems to work. I had played with the "EMPTY" value a bit, but couldn't get it to work in an expected way either. But your lines of code seems to do the trick. I am having a few issues unaccounted for, as the total amount of issues without checking for links: 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) ORDER BY created DESC

 isn't equal to the sum of issues without test links and the issues with test links: 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) AND (issueLinkType != Testers or issueLinkType is EMPTY) ORDER BY created DESC

plus 

project in (xxx) AND issuetype in (Epic, Feature, Story) AND status = Done AND fixVersion in (xxx) AND issueLinkType = Testers ORDER BY created DESC

I will try to figure that one out this morning. 

Christian Wietholt February 3, 2021

Looks like there are fewer entries in the query that lists issues without testers or empty (2nd query in the last post) than there should be.  Apparently, the filter doesn't show any issues that doesn't have an Epic Link. 

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 3, 2021

@Christian Wietholt

I'm seeing issues returned that both have and do not have an Epic Link. I'm afraid I'm not quite sure what behavior you are seeing!

Thanks,

Kian

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 3, 2021

@Christian Wietholt @Kian Stack Mumo Systems 

Perhaps Christian is experiencing the problem documented here:

https://jira.atlassian.com/browse/JRACLOUD-73640

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 3, 2021

@Trudy Claspill

That's a good find! It looks like that could certainly be the case!

Thanks,

Kian

Christian Wietholt February 3, 2021

@Trudy Claspill That is a good find indeed and explains exactly what I did. It even shows a workaround that I was trying to do but didn't know how to in my rookie JQL state. :-) Nice to know that I can use previous created filters in my new query. 

 

Thank you so much for all you help. Much appreciated. 

0 votes
Kate Kabir
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.
February 2, 2021

Hi Christian

Thank you for your question.

I can confirm that in JIRA Cloud you can only use the issueFunction() JQL function provided by ScriptRunner on the Enhanced Search page as described in the documentation here and this is the reason why you were getting the issueFunction not found error when you try to run the search in the standard JQL search inside of Jira Cloud.

This is due to the way that Atlassian restrict how the JQL functions can interact with their infrastructure meaning we must run them in a sandbox process.

This means that to run the search you should navigate to the enhanced search page located at the URL of <JiraBaseURL>/plugins/servlet/ac/com.onresolve.jira.groovy.groovyrunner/jql-search-view and to run the search on this page.

However this does not mean that they cannot be used inside other filters or on filters for Agile boards, and to use the functions in other filters then you will need to follow the steps outlined below.

  1. Navigate to the enhanced search page and construct the filter you require using the JQL functions provided by ScriptRunner.
  2. Save your filter and share it with the users that are required to be able to see it.
  3. Create the JQL search used by your board filter or quick filter and reference the saved filter using the syntax shown below which will return the results of your filter using the JQL functions provided by ScriptRunner.
filter = "<NameOfFilterHere>"

I would also advise reading through the page located here inside of the ScriptRunner for Jira Cloud documentation site, as this page explains in more details the differences between the Server and Cloud versions of ScriptRunner and will show what functionality that the server version contains which is different or does not exist inside of the cloud version.

The issueLinkType JQL keyword as described here and before using this in your search you will need to make sure you have synchronised keywords in your instance by following the steps outlined here.

I hope this information helps.

Thank You

Kate

Christian Wietholt February 3, 2021

Sorry, this seems to be completely not answering my question. I do not get the "issueFunction not found" error message, and I have no idea what question the answer even attempts to answer. Are you just trying to sell me here a Jira extension that I don't need? 

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.
February 3, 2021

Hi Christian,

Can I please ask when using the IssueLinkType keyword are you using the one provided by ScriptRunner for Jira Cloud as Kate was referring to the keyword that ScriptRunner for Jira Cloud provides and explaining how this works.

If you are not using ScriptRunner for Jira Cloud then can you please advise what add on you are using as the IssueLinkType function does not exist in Jira Cloud unless you have an add on installed?

Regards,
Kristian

Christian Wietholt February 3, 2021

Hi Kristian, 

I am not using any add on. I found the issueLinkType keyword here and I can't find any mentioning of scriptrunner on this page. That's the reason I was confused about Kate's messages and thought I am getting an unsolicited sales pitch. I am sorry if that was not the case. 

Best Regards, 

Christian 

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.
February 3, 2021

Hi Christian,

Thank you for your response.

I apologise for the confusion here as ScriptRunner for Jira Cloud has a keyword with the same name and I believe Kate thought you were using the one provided by ScriptRunner which is why she tried to assist by explaining how this works.

I apologise for any inconvenience this has caused to yourself.

Regards,

Kristian

Like # people like this
Christian Wietholt February 3, 2021

No worries, and no inconvenience at all. I totally understand now how this is connected, which wasn't apparent to me before. Thanks for explaining it. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events