Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Return all unresolved issues in a hierarchy using Scriptrunner nested query

I have this link structure in JIRA: "Initiative" then "task" (or "Epic" then "task"). I would like to filter all unresolved issues in a particular Initiative.

I can get the unresolved direct children of the Initiative with this:

issueFunction in linkedIssuesOf("resolution is empty and issuekey=PM-20", "is Initiative parent of") and resolution is empty

but I'm not sure how to add in the children of any child epic(s). So far, using the Scriptrunner insert function wizard, I have this:

issueFunction in issuesInEpics(" issueFunction in linkedIssuesOf("issuekey= PM-20", "is Initiative parent of") and resolution is empty") and resolution is empty

The error I get is "Failed to get issues in epic". I don't have any experience with nested queries. Help..?

Doug

1 answer

Hi @Doug Robinson 

Thank you for the question.

If you are using Scriptrunner For Jira Cloud, we do not support running nested queries inside of the subqueries for JQL functions.

I can, however, confirm that this means that you will first to create a query to return the results for your enhanced search function and you will need to save this as its own filter.

You will then need to create a second query which calls this saved filter inside of the subquery for your enhanced search function in order to return all the issues in the Epics for the filer you saved previously.

For your reference, I can confirm that the JQL that you would use in the subquery to return the results of the filter is filter = <NameOfFilterHere>.

You will then be able to update the JQL for your second query to be similar to the below so that it returns the results of the first filter inside the subquery for the JQL function.

issueFunction in <JqlFunction>("filter = <NameOfFilterHere>")

I hope this information helps.

Thank you. 

Kind Regards

Kate

Hi @Doug Robinson 

However, I have looked into your question further and believe you may be able to use the approach outlined in the Atlassian Community Article located here along with the linkedIssuesofRecursive() function and here a potential guide to achieving your requirement.

I hope this helps.

Kind Regards

Kate

Kate, 

Thank you!  The issueFunction in <JqlFunction>("filter = <NameOfFilterHere>") approach worked

My final filter is the union of the two Scriptrunner filters: (filter = "PM-20 direct children" OR filter = "PM-20 epic children") AND resolution is EMPTY

:)

Regards,
Doug

Like Kate Kabir likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Marketplace Apps & Integrations

☕️ Monday coffee with Jexo: Weekly Atlassian news roundup | 21st June 2021

Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...

60 views 0 6
Read article

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