Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

JQL with a condition on one criteria

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 Feb 02, 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 

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...

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 

 

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)

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

image.png

Tessa Tuteleers Community Leader Feb 03, 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! 

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

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