My script to return the number of cloned issues not working as expected. it always returns 1.
Anyone know what the error might be? Also if I need to display the number of links that 'depend on' another link what do I replace the 'Cloners' with?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkType
import com.atlassian.jira.issue.link.IssueLinkTypeManager
ComponentAccessor componentAccessor= ComponentAccessor.newInstance()
Collection<IssueLinkType> issueLinkTypes=componentAccessor.getComponentOfType(IssueLinkTypeManager.class).getIssueLinkTypes();
count = 0;
for (IssueLinkType linktype : issueLinkTypes) {
String name=linktype.getName();
if(name.equals("Cloners")){
count++;
}
}
return count;