I need to show the parent task of a sub task in a filter

Riccardo Zaniboni July 9, 2018

I want to show a list of all sub tasks open and the related parent issue in a column.

project = XXX AND status = Open AND issuetype = Sub-task AND labels = XXX

How can I do it?

 

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
sudhakar July 12, 2018

Hi 

 can  get list of parent issues which are in To Do using   JQL Search Extensions plugin 

 

 

issue in parentOf("issueType = Bug") which gives us Find parents of subtasks with issue type = Bug. 

issue in subtaskOf("status = Open") which gives us subtasks of parents with status = Open.

 

Plugin Link : https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira?hosting=server&tab=overview 

 

Regards,

Sudhakar

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2018

Riccardo,

  I don't believe there is any delivered functionality that will allow you to do this.  You can use one of two plugins to accomplish this.

Scriptrunner or Craftforge Search Linked Issues for JIRA

More information can be found here about Craftforge - https://confluence.atlassian.com/jirakb/howto-filter-to-show-sub-tasks-of-a-filtered-list-of-parent-tasks-351109518.html

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2018

If you look at the scriptrunner option, I usually do it with a scripted field that does something like the pseudo-code of:

if (issue.issuetype in subtask-types)
return issue.getParentIssue().getKey() + " : " + issue.getKey()
else
return issue.getKey()

 This gives you a field that you can sort on by the parent ID and group all the sub-tasks with it.  I usually go a bit further and drop them out as urls to the issues, but you can see where I;'m going.

Craftforge will do the same job for you without having to write any code.

Loïc Dewerchin January 6, 2021

The scriptrunner options works well with a scripted field like you suggested :).

In our case we just wanted to have the name of the parent of the subtask, not the keys.

 

Adding the script in case anyone has the same problem :

package your.package

import com.atlassian.jira.issue.Issue;
import org.apache.log4j.Logger;

def log = Logger.getLogger("your.package")
if (issue.isSubTask()){
//log.info("log something if you want");
return issue.getParentObject().getSummary();
}else{
//return null because we do not want the custom field to appear when there is no value
return null;
}


 

Don't forget to add "your.package" to the Logging  and profiling : "configure logging level for another package".

Use searcher "none" for your field config to not needlessly add extra indexing.

Just add the new scripted field as a column of your query result page.

0 votes
Alexey Matveev
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.
July 9, 2018

Hello,

If you want to show the related parent issue, you should create a custom field, which would provide this information. Then you can add this field as a column in the Issue Navigator. You can create such a field with the Power Custom Fields add-on. It is a free add-on:

https://marketplace.atlassian.com/apps/1210749/power-custom-fields

Or with ScriptRunner or any other plugin.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question