A simple script to obtain a list of the names of the statuses of your Jira


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.StatusManager
StatusManager statusManager = ComponentAccessor.getComponentOfType(StatusManager.class)
return statusManager.getStatuses()*.getName()

By MrAddon

Posted by:.

One thought on “How to get a list of Statuses of Jira with Groovy

  1. Example to search for statuses that contains some text

    import com.atlassian.jira.component.ComponentAccessor
    import com.atlassian.jira.config.StatusManager
    StatusManager statusManager = ComponentAccessor.getComponentOfType(StatusManager.class)
    def statuses = statusManager.getStatuses()*.getName()
    def i = 0
    def result = ""
    while (i < statuses.size()) {
    if ( statuses[i].toLowerCase().contains("prod"))
        result= result + "," + statuses[i] 
    i++
    }
    return result
    

    Like

Leave a Reply to . Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s