Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Remove link from parent to child jira api

Paz Grimberg July 26, 2016

Hi All,

Im trying to convert my un-done subtasks to tasks when closing the parent issue throw the parent WF (scripted post function). 

The convert operation works fine for me but i need to unlink the parent  - child link.

Do you know how can i do it with JIRA 7 api?

Thanks!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Petar Petrov (Appfire)
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 26, 2016

Since you are talking about a scripted post function, I assume you are asking about the Java API. You can do the following:

IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager();
IssueLink issueLink = issueLinkManager.getIssueLink(sourceIssueId, targetIssueId, issueLinkTypeId);
issueLinkManager.removeIssueLink(issueLink, applicationUser);

where sourceIssueId is the id of the issue which is the source of the link, targetIssueId is the id of the issue which is the destination of the link, issueLinkTypeId is the id of the type of the link. applicationUser is the user which performs the operation - usually the currently logged-in user.

Paz Grimberg July 27, 2016

Thanks!!! smile

TAGS
AUG Leaders

Atlassian Community Events