Skip to main content
Example scripts
arrow icon
To homepage
Jira
Data centre icon
Data Center

Create New Boards with the ScriptRunner Console

Created 1 year ago, Updated 1 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira (8.5 - 8.22)
compatibility bullet
ScriptRunner For Jira (6.48.1)
Language |
groovy
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
RapidViewHelper rapidViewHelper

//Specify the Project Key
final def projectKey = '<PROJECT_KEY>'

//Specify the Board Name
final def boardName = '<BOARD_NAME>'

//Specify the Board Type e.g. scrum or kanban
final def boardType = '<BOARD_TYPE>'

def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def projectManager = ComponentAccessor.projectManager

def projectIds = [projectManager.getProjectObjByKey(projectKey).id as String]
def outcome = rapidViewHelper.createRapidViewForPreset(currentUser, boardName, projectIds as Set, boardType)

log.debug outcome

if (!outcome.valid) {
    log.warn "Failed to create board: ${outcome.errors}"
}
Having an issue with this script?
Report it here