Example scripts
To homepage
Jira

Count Stories Per Project
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
import groovy.xml.MarkupBuilder
def mapping = Issues.search("issuetype = Story").countBy { issue ->
((Map<String, Map>) issue.fields).project.key
}
def writer = new StringWriter()
def builder = new MarkupBuilder(writer)
builder.table(class: "aui") {
thead {
tr {
th("Project Key")
th("Count")
}
}
tbody {
mapping.each { projectKey, count ->
tr {
td {
b(projectKey)
}
td(count)
}
}
}
}
writer.toString()
Having an issue with this script?
Report it here