Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,091
Community Members
 
Community Events
168
Community Groups

Why does Parent Issue loose subtasks when moved back to beginning of workflow?

Edited

Using a jira board to track assets. Some assets come in a kit and the idea was to have the kit components as sub-tasks under one main issue for the kit. When the kit is moved to 'in progress' the subtasks are still linked to the kit, but when the kit is moved back to 'To Do' the subtasks are no longer linked to the parent kit issue

Update:
May be because one of our groovy scripts remove links from the the parent issue. Is a Subtask considered a link and if so what type?

2 answers

1 accepted

1 vote
Answer accepted

Are the issues really sub-task issue types or are the other issue types linked to the main issue?

Do you have the issue key for one of those sub-tasks that has disappeared? If so, try browsing for it to see if the issue actually still exists and has been modified or has truly been deleted.

the issues are really sub-task issue types and the sub-tasks are not deleted they just have no parent anymore

```

IssueLink link in linkMgr.getOutwardLinks(issue.id){

    linkMgr.removeIssueLink(link, roboUser)
```
Does this include sub-tasks if linkMgr = ComponentAccessor.getIssueLinkManager()?



The only way to do that is with code that removes the parent issue, forcibly, overriding the relationship that Jira enforces.

It is also possible to hide the relationship, which makes them look orphaned, but you can't do that in the workflow, you have to change the parent's issue type!

Ah, cross commenting.  Yes, that would damage the sub-task relationships - part (not all) of it is stored as (an invisible) issue llink.

ya sorry about the two cross comments, thought the other would be a little simpler. 

If I were to add an if statement that checks for a subtask link could i do something like this:

if link.issueLinkType.name == subtask  //<-- Not sure what linkType this would be

My fault just as much as yours!  We can't know when someone else is going to post!

Yes, that's a good way to do it. 

Issue link types are stored in a database table that looks like this on a mostly untouched new Jira, so my guess is that you'll see the entry in the linkname column

 

id linkname inward outward pstyle
10100 jira_subtask_link jira_subtask_inward jira_subtask_outward jira_subtask
10000 Blocks is blocked by blocks NULL
10001 Cloners is cloned by clones NULL
10002 Duplicate is duplicated by duplicates NULL
10003 Relates relates to relates to NULL
10200 Epic-Story Link has Epic is Epic of jira_gh_epic_story
10201 Problem/Incident is caused by causes servicedesk_automation_default_linktype
Like Trudy Claspill likes this

sweet thanks, this should solve the problem!

1 vote

Welcome to the Atlassian Community!

This suggests an automation or script (post function or listener) that is deleting or changing the parent of the sub-tasks such that they disappear from the parent issue.

Check with your admins what they have set up in the project, or listeners.

Suggest an answer

Log in or Sign up to answer