Create a board and filter with custom settings using script runner

Hi team,

 

Using scriptrunner I have been able to create a board, which creates a custom filter. I now want to be able to configure that custom filter in the same script so that it has a predefined JQL query.

Code as per below.

 

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
import com.atlassian.greenhopper.web.rapid.view.RapidViewResource.CreateResponse
import com.atlassian.greenhopper.web.rapid.view.RapidViewFilterHelper
import com.atlassian.greenhopper.web.rapid.view.RapidViewCreateModel
import com.atlassian.greenhopper.service.rapid.view.


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

@JiraAgileBean
RapidViewService rapidViewService

@JiraAgileBean
RapidViewHelper rapidViewHelper

def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def errorCollection = new ErrorCollection()

// create a new board for project JRA
def projectIds = [ComponentAccessor.getProjectManager().getProjectObjByKey("ATP").id as String]
def outcome = rapidViewHelper.createRapidViewForPreset(currentUser, sourceIssue.summary + " Board", projectIds as Set, "scrum")
log.debug outcome

if (! outcome.isValid()) {
log.warn ("Failed to create board: ${outcome.errors}")
return
}

log.info ("Create board successfully.")

 

 

1 answer

Hi George ,

We also have a similar requirement for adding custom filters using script. Did you find any solution to it?

Thanks In Advance

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

452 views 2 5
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you