Is a subtask considered a link and if so what type?

Steven VanderVelde August 9, 2022

Is a subtask on a parent issue considered a link on that parent issue?

1 answer

0 votes
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.
August 9, 2022

No, they're not considered to be issue links.

In the background, sub-tasks and issue-links have a lot in common, but because sub-tasks are a fragment of an issue and links show a non-hierarchical relationship between two issues, they look and behave very differently.

Steven VanderVelde August 9, 2022

so if i was writing a groovy script:

linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getOutwardLinks(issue.id)){

...

}

the for loop would not include sub-tasks if the issue.id is the parent?

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.
August 9, 2022

It might, but I cannot remember.

Sub-tasks are partially stored as an issue link type, one that is hidden from the UI.  I can't remember if the API is clever enough to ignore them when you use that code.  I'd recommend ignoring them in your script though, you need to do some extra stuff in other places if you're changing parent/sub-task links.

Steven VanderVelde August 9, 2022

if i was only trying to remove links and leave sub-tasks attached to the parent could that be done?

Radek Dostál
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.
August 9, 2022

IssueLinkManager will not get or remove subtask links - Jira does not consider them as issue links.

Subtasks go through https://docs.atlassian.com/software/jira/docs/api/8.22.6/com/atlassian/jira/config/SubTaskManager.html

Suggest an answer

Log in or Sign up to answer