Created
March 26, 2014 16:43
-
-
Save jechlin/9787666 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples | |
import com.atlassian.greenhopper.model.validation.ErrorCollection | |
import com.atlassian.greenhopper.service.rapid.view.RapidViewService | |
import com.atlassian.greenhopper.web.rapid.view.RapidViewHelper | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.onresolve.scriptrunner.runner.customisers.JiraAgileBean | |
import com.onresolve.scriptrunner.runner.customisers.WithPlugin | |
@WithPlugin("com.pyxis.greenhopper.jira") | |
@JiraAgileBean | |
RapidViewService rapidViewService | |
@JiraAgileBean | |
RapidViewHelper rapidViewHelper | |
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() | |
def errorCollection = new ErrorCollection() | |
def views = rapidViewService.getRapidViews(currentUser, errorCollection) | |
// list names of current boards | |
log.debug views*.name | |
// create a new board for project JRA | |
def projectIds = [ComponentAccessor.getProjectManager().getProjectObjByKey("JRA").id as String] | |
def outcome = rapidViewHelper.createRapidViewForPreset(currentUser, "Board for JRA", projectIds as Set, "scrum") | |
log.debug outcome | |
if (! outcome.isValid()) { | |
log.warn ("Failed to create board: ${outcome.errors}") | |
return | |
} | |
log.info ("Create board successfully.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment