Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package examples.docs
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.pyxis.greenhopper.GreenHopper
@WithPlugin("com.pyxis.greenhopper.jira")
@JiraAgileBean
GreenHopper greenHopper
def grantedProjects = greenHopper.getGHConfiguration().getGrantedProjects()
def projectManager = ComponentAccessor.getProjectManager()
if (grantedProjects.isEmpty()) {
log.info ("All projects enabled")
}
else {
log.info("The following projects are enabled: " + grantedProjects.collect {projectManager.getProjectObj(it).name})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.