Should hopefully be a simple one - How do I get the issue link type ID from the issue link type name using the standard API. For example, if I want to retrieve the link type ID from the link called "Duplicates"
Community moderators have prevented the ability to post new answers.
check this question
https://answers.atlassian.com/questions/195358/de-linking-an-issue
and also check IssueLinkManger
Thanks! For reference to anyone else, this is the code I built for my particually scenario using the above answers a guide. Note that this is currently un-tested, but if it doesn't work I will come back and change the answer where necessary
String issueLinkName = "Code Block"; long issueLinkTypeId; Iterator<IssueLinkType> issueLinkTypes = ((IssueLinkTypeManager) ComponentAccessor.getComponentOfType(IssueLinkTypeManager.class)).getIssueLinkTypesByName(issueLinkName).iterator(); Boolean foundIssueLinkType = false; if (issueLinkTypes.hasNext()) { IssueLinkType issueLinkType = issueLinkTypes.next(); issueLinkTypeId = issueLinkType.getId(); } else { throw new Exception("Could not find '" + issueLinkName + "' issue link type"); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.