Hi,
I have the following "Custom script post-function" Groovy code
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
List<IssueLink> innerLinks = issueLinkManager.getInwardLinks(issue.getId())
List<IssueLink> outerLinks = issueLinkManager.getOutwardLinks(issue.getId())
for(issueLink in innerLinks){
def linkTypeName = issueLink.getIssueLinkType().getName()
log.debug(String.format("innerlink: current issuelink type name is %s", linkTypeName))
}
for(issueLink in outerLinks){
def linkTypeName = issueLink.getIssueLinkType().getName()
log.debug(String.format("outerlink: current issuelink type name is %s", linkTypeName))
}
I have an issue PRJ-123 that has Type = "Sub-task".
I click on "Resolve Issue" and I specify:
"Duplicate" for the "Resolution" field
"duplicates" for the "Linked Issues" field
and PRJ-987 for the "Issue" field.
In the logfiles, i see :
innerlink: current issuelink type name is jira_subtask_link
I was expecting to see "Duplicate" instead of "jira_subtask_link" :
outerlink: current issuelink type name is Duplicate
For another issue that is of Type = "Bug", i see the issuelink as "Duplicate".
So how can i find the "Duplicate" issuelinks of an issue that has Type = "Sub-task" ?
Thanks
--Andrew
Hello, when you add a link it does not mean that you delete the old link. And if you see only the subtask link, it means that you script works before the link was created.
Hello @Andrew L
Is Duplicate an bi-directional link? Because I think it's working fine because for the innerLink on the sub-task you see the dedfault "jira_subtask_link" which exists between the existing sub-task and its parent and the "duplicate" link which you have set can be a uni-directional outer link from the sub-task to the issue key which you have mentioned.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply.
I think "duplicates" is an outward link and "is duplicated by" is an inward link.
It turns out my requirements have changed and i no longer need to loop through the issue links.
--Andrew
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.