JQL with a condition on one criteria

CécileV February 2, 2021

Hello,

Can someone help me to write a JQL search for the following query:

In a given project (PRO1), I want to list all the issue types A (MIR) that have at least one link (link = "is MIR of" ) to an issue type B (SRS), but only the SRS in status APPROVED

I started to write:

project = PRO1 AND issuetype = MIR AND issueLinkType = "is MIR of"

but I don't know how to integrate the filter on the SRS' APPROVED status.

Any idea?

1 answer

1 accepted

0 votes
Answer accepted
Tessa Tuteleers
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

Hi @CécileV , 

I'm not sure if this can be done without the Scriptrunner app, but if you have that, you could use 

project = "PRO1" AND issuetype = MIR AND issueFunction in linkedIssuesOf("issuetype = SRS AND status = approved", "is Mir of")

Hope this helps! 

- Tessa 

CécileV February 2, 2021

Hi Tessa, thanks a lot for your fast reply. 

I got this error message: "Error in the JQL Query: Expecting ')' before the end of the query."

I place the ")" at the end, first, the result didn't show any issue.

I placed it after approved", then I got a error message again.

However, I know the result should not be empty...

Tessa Tuteleers
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

Hi @CécileV , 

just to be sure, you do have scriptrunner on your instance? 
Could you copy paste your JQL to here? Perhaps add a screenshot in there as well? 
Maybe the screenshot of an issue of which you are sure to match the conditions mentioned? 
The one I posted seems to work for me, so I'd like to check what is different. 

Keep in mind, this query will find issues that: 

- Are in project PROJ1 +

- Are of the issuetype MIR + 

- Are linked to issues of issuetype SRS that are in status approved with the "Is Mir of" link 

CécileV February 2, 2021

 

Yes Tessa, I confirm we have Scriptrunner.

I also confirm that what you mention as a result is what I expect.

But here is what I get (screenshot)

CécileV February 2, 2021

image.png

CécileV February 2, 2021

This is an exemple of a MIR linked to a SRS in APPROVED status :

image.png

Tessa Tuteleers
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 @CécileV , 

Thanks for the screenshots, I see the problem now! 

Let's revisit the JQL: 

issueFunction in linkedIssuesOf("issuetype = SRS AND status = approved", "is Mir of")

This part of the JQL says, find me linked issues of .....
So this part of the JQL talks about the linked issue, not the issue you ant to find. 

As you might know, issuelinks have a name, and 2 parts, an inward, and an outward part: 
Screenshot 2021-02-03 at 09.41.57.png

In your JQL you ask for issues linked with "Is MIR of", yet in the issue you are looking for, the link is "Is MIR of". 
Could you check the linked issue itself (PFM-3949) and check what the other half of the link is called? 
That's the name you should add to the JQL ;) 

Let me know if this works! 

CécileV February 3, 2021

Hi Tessa,

That's wonderfull, it works! Many thanks for your help :-)

Cécile.

Like Tessa Tuteleers likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.2
TAGS
AUG Leaders

Atlassian Community Events