Forums

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

Query for all parent items for tasks or sub-taks.

PM
Contributor
March 20, 2022

I started with a simple goal: to show the user’s current tasks and the hierarchy (full chain) of parent items. To make it more visible for the user: how his tasks is related to the Project\Sprint goals. I wanted to create and save the filter and show it in a hierarchy view with the WBS-Gant plugin.

To make the filter I am Trying to use parentsOf from the ScriptRunner for Jira Cloud plugin.

issueFunction in parentsOf("ASSIGNEE = 62079a086ba61b006fb737c4 And issuetype != Epic")

The plugin is installed and synchronized. The sub-query in parentsOf returns a list of items for the user. But the query with parentsOf return 0 items. No errors there.

For sure every task in the sub-query is part of some user story or epic.  And some results must be there.

Maybe someone has the same experience and has a solution?

1 answer

0 votes
Antoine Berry
Community Champion
March 21, 2022

Hello @PM ,

a parent issue in Jira means it has a sub-task linked to it. So if the issues of the subquery are not subtasks, the whole query will not return anything.

Does this query return any issue ? 

ASSIGNEE = 62079a086ba61b006fb737c4 and issuetype in subTaskIssueTypes() 

If you wish to get issues in an Epic, you can use

"Epic Link" is not empty

So your whole query could be : 

issueFunction in parentsOf("ASSIGNEE = 62079a086ba61b006fb737c4 and issuetype in subTaskIssueTypes()") or "Epic Link" is not empty
PM
Contributor
April 3, 2022

Thank you for the answer.

I got the error. 

Your JQL includes the [parentsOf] function from the [Adaptavist Scriptrunner] app for Jira Server. This function works differently in Jira Cloud. Refer to https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-jql-keywords-functions for details or contact the app provider.

I am reading the article. Rewrite the query. But not able to get result. 

Like Antoine Berry likes this

Suggest an answer

Log in or Sign up to answer