Forums

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

Childs from Initiatives up to Sub-tasks

Per Wilhelm December 15, 2023

Hello,

 

We have realized the following (possible) structure / hierachy in our JIRA:

  • Initiative --> Epic --> Task --> Sub-task
  • Initiative --> Task --> Sub-task

Adaptavist ScriptRunner for JIRA is installed.

 

Question: With which JQL query do we get all childs from an Initiative (INIT-1) up to all Sub-tasks?

3 answers

1 accepted

0 votes
Answer accepted
Fazila Ashraf
Community Champion
December 19, 2023

Hi @Per Wilhelm 

I do not have a DC setup to test this but could you try below to fetch the children of initiative ABC-1 and the subtasks and see if it helps.

issueFunction in portfolioChildrenOf('key=ABC-1') or (issueFunction in subtasksOf("issueFunction in portfolioChildrenOf('key=ABC-1')"))

 

reference -> https://docs.adaptavist.com/sr4js/latest/features/jql-functions/included-jql-functions/portfolio#portfoliochildrenof-examples

Per Wilhelm December 19, 2023

Your JQL query

issueFunction in portfolioChildrenOf('key=ABC-1')

does not consider the follwing tasks:

  • Initiative --> Epic --> Task

and therefore its Sub-tasks are also not taken into account.

If I combine the answers from you and @Marc - Devoteam I think I get a valid JQL query:

issuekey in ('INIT-1') OR issuekey in childIssuesOf('INIT-1') OR issueFunction in subtasksOf("issuekey in childIssuesOf('INIT-1')")

Another JQL query that outputs the same scope is:

issuekey in ('INIT-1') OR issuekey in childIssuesOf('INIT-1') OR parent in childIssuesOf('INIT-1')

which looks a little 'strange' to me. I would prefer the query above, which is a combination of your two answers.

Like # people like this
0 votes
Fazila Ashraf
Community Champion
December 15, 2023

Hey @Per Wilhelm 

Try below if ABC-1 is the initiative ticket

issuekey in portfolioChildIssuesOf("ABC-1")

Marc - Devoteam
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.
December 15, 2023

Hi @Fazila Ashraf 

This is a cloud only function and @Per Wilhelm specified he is on server.

Fazila Ashraf
Community Champion
December 15, 2023

ah..i missed to notice that. 

Thanks @Marc - Devoteam ! 

Like Marc - Devoteam likes this
0 votes
Marc - Devoteam
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.
December 15, 2023

Hi @Per Wilhelm 

This can only be achieved by adding a marketplace app that is able to provide extra JQL options.

Like

Per Wilhelm December 17, 2023

Adaptavist ScriptRunner for JIRA is installed. Sorry for not mentioning that.

Marc - Devoteam
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.
December 18, 2023

Hi @Per Wilhelm 

JQL: issuekey in childIssuesOf("INT-1")

Per Wilhelm December 18, 2023

Thanks for the first part of the answer, but I also need all Sub-taks for the following two structures / hierarchies:

  • Initiative --> Epic --> Task --> Sub-task
  • Initiative --> Task --> Sub-task
Marc - Devoteam
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.
December 18, 2023

Hi @Per Wilhelm 

So I assume you have 2 different structures with both it's own hierarchy.

If I look at the structure documentation, you should be able to use:

issue in structure("your structureName", INT-1)

Per Wilhelm December 18, 2023

The term structure was perhaps misleading. I mean the following hierarchy in JIRA. For the Sub-tasks on the lowest level I would still need the JQL query.

Hierarchy levels.PNG

Per Wilhelm December 19, 2023

@Fazila Ashraf @Marc - Devoteam Any idea for the JQL query for the missing Sub-tasks?

Suggest an answer

Log in or Sign up to answer