Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help needed for JQL

Ankit Mahajan April 2, 2021

 For the below scenario - I am trying to come up with JQL but not able to. Tried "IssueFunction" etc or referring Script Runner https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_epicsof. If anyone has any inputs for the below scenario, can you please share?

Show me all the Stories that have a Pcode “A” AND Epic Link of stories is not with Pcode “A” or with Component Value “B”

Note- Pcode and Component are Fields in both Stories and Epics

2 answers

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.
April 4, 2021

Hi @Ankit Mahajan 

I can confirm that if you are using ScriptRunner for Jira Cloud, it does support issuesInEpics() JQL function documentation page under Enhanced Search Included Functions located here. You may kindly refer to the documentation on how to configure the JQL.

I hope this helps

Kind regards,
Kate

0 votes
Ste Wright
Community Champion
April 2, 2021

Hi @Ankit Mahajan 

In terms of Scriptrunner, make sure you're following the instructions for Cloud not Server, as these do differ.

From what I understand above, you want to see:

  • All Stories with Pcode "A"...
  • That are children of Epics which...
  • Do not have a Pcode of "A" OR...
  • Have a component of "B"

If yes, something along these lines should work...

issueFunction in issuesInEpics("component = B OR Pcode != A") AND issuetype = Story AND Pcode = A

This is how it works:

  • The function issuesInEpics will show all children of any Epic which satisfies the subquery.
  • The subquery in the brackets searches against all Epics, based on the relevant search parameters.
  • The and Pcode = A refines the results based on the parameters referring to Story-level

You might need to change this slightly based on field name or field type (for the operators), but this should work!

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events