.'s avatar
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