Example scripts
To homepage
Jira

Search and Link Issues
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.0 - 8.19)

ScriptRunner For Jira (7.10.0)
Language |
groovy
def matchingIssuesJqlQuery = """
project = 'SR'
AND component = Safari
AND labels IN (Elephant, Hippo)
"""
def matchingIssues = Issues.search(matchingIssuesJqlQuery)
def featureIssue = Issues.getByKey('SR-1') // Issue which all the other issues will be linked to
matchingIssues.each { issue ->
// Other link type values can be set depending on the
// Outward/Inward Descriptions in "Issue linking" configuration, e.g.:
// 'blocks', 'is blocked by', 'clones', 'is cloned by', etc.
issue.link('relates to', featureIssue)
}
Having an issue with this script?
Report it here