Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to create a board using a saved filter via Scriptrunner?

Julia August 9, 2023

Hi there, I'd like to modify this script to create a board, but instead of tying it to a project, use a saved JQL filter. Any help ? Thanks!

 
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


//Create Board


@WithPlugin('com.pyxis.greenhopper.jira')

@JiraAgileBean


RapidViewHelper rapidViewHelper

def currentUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser

def projectManager = ComponentAccessor.projectManager



def projectIds = [projectManager.getProjectObjByKey("PTDEMO").id as String]

def outcome = rapidViewHelper.createRapidViewForPreset(currentUser, "Testing Board Create", projectIds as Set, "kanban")

log.warn outcome


if (!outcome.valid) {

log.warn "Failed to create board: ${outcome.errors}"

}

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2023

Hi Julia,

Replace the createRapidViewWithPreset with createRapidViewWithFilter (user, name, filter id, kanban/scrum)

TAGS
AUG Leaders

Atlassian Community Events