Hi Community
I would like to get some assistance with Scriptrunner for an existing script we have. In its current form the script returns some specific field data from linked issues and is used in reporting however there is now a requirement to exclude issues of a particular status.
I am unsure how to construct the exclusion part of the script and need a bit of help with this. I want to exclude issues that are either in "Live" or "Withdrawn" statuses.
Script - Current form
import com.atlassian.jira.component.pico.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def cfManager = ComponentAccessor.getCustomFieldManager()
def retVal = ''
// Get only outward links
def links = issueLinkManager.getOutwardLinks(issue.id)
def itr = links.iterator()
while (itr.hasNext()) {
def link = itr.next()
// Only care about "depends on" link types
if (link.issueLinkType.name != 'Depends') {
continue
}
// Get other issue
def linkedIssue = link.destinationObject
// Line seperators if more than one ticket
if (retVal != '') {
retVal += '<br>'
}
retVal += "${linkedIssue.getKey()} [${linkedIssue.getStatus().getName()}] - ${linkedIssue.getSummary()} "
}
return retVal
Thanks in advance for any assistance offered.
Regards, Jamie