Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,892
Community Members
 
Community Events
168
Community Groups

Bulk update workflow, Issuetype, Screen Scheme for multiple project at once

Hello

I am looking for a solution to update schemes for multiple project at once (100 ).
verified adaptivist library able to find for permission scheme.
Issuetype Scheme
Screen Scheme

Workflow Scheme

Field configuration scheme
 Can anyone suggest a script/ method that reduce the manual work to update each project.

1 answer

If anyone looking for a script. the following Scripts will work in Scripted console( Script runner).

Permissions Scheme 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project

def list = ["TEST"]

for(item in list){
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey(item)

log.warn("Project is:"+project)

String permissionScheme = "Target Permission Scheme"

ComponentAccessor.getPermissionSchemeManager().removeSchemesFromProject(project)
ComponentAccessor.getPermissionSchemeManager().addSchemeToProject(project, ComponentAccessor.getPermissionSchemeManager().getSchemeObject(permissionScheme))
}

 

 

Notification Scheme


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project
def list = ["TEST"]

for(item in list){
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey(item)

log.warn("Project is:"+project)

String notificationScheme = "Target Notification Scheme"

ComponentAccessor.getNotificationSchemeManager().removeSchemesFromProject(project)
ComponentAccessor.getNotificationSchemeManager().addSchemeToProject(project, ComponentAccessor.getNotificationSchemeManager().getSchemeObject(notificationScheme))

 

Work flow Scheme

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.Project
def list = ["TEST"]

for(item in list){
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey(item)

log.warn("Project is:"+project)

String workflowScheme = "Target Workflow Scheme"

ComponentAccessor.getWorkflowSchemeManager().removeSchemesFromProject(project)
ComponentAccessor.getWorkflowSchemeManager().addSchemeToProject(project, ComponentAccessor.getWorkflowSchemeManager().getSchemeObject(workflowScheme))

 

But for Other entries IssuetypeScheme, Screen Scheme, Field configuration Scheme Script Is not working.
 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.4
TAGS

Atlassian Community Events