Hello,
I'm planning to remove the linked issues of type clones for the linked issue type story and linked issues is from any projects .I was able to remove the issue links for issuelink type cloners but not able to make for the linked issues linked from other projects with linked issue type story.
Here is my code .But my code removes all links even condition is added .I'm looking some thing to check the linked issue status before remove. suggestion please
port com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.user.ApplicationUser
ApplicationUser loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
IssueLinkManager issueLinkManager = ComponentAccessor.getIssueLinkManager()
issueLinkManager.getInwardLinks(issue.getId()).each {issueLink ->
if (issueLink.getIssueLinkType().getName().equals("System Test Execution") && issue.issueType.name == 'Story'){
issueLinkManager.removeIssueLink(issueLink, loggedInUser)
}
}