Hello,
i like to bulk change Project Schemes with Script Runner.
For Example change all Issue Type Screen Schemes or Workflows etc.
Is there any Script out there to accomplish this?
Thanks!
Hi,
See this links:
https://community.atlassian.com/t5/Jira-questions/how-to-use-script-runner-to-switch-project-workflow-scheme/qaq-p/667906
https://community.atlassian.com/t5/Jira-questions/How-to-update-project-permission-automacitally/qaq-p/702581
Try this on test environment first.
Here is the working code, folks!! It perfectly works.*Just copy and paste* in your Script Runner's Script Console. Replace the below Project keys with your list (you can put up to *50 Project keys in one go*.. it processed first 50 keys, when I added 75 keys) and replace the Target Permission Scheme name.====================
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.project.Project
def list = ["Proj Key 1", "Proj Key 2", "Proj Key 3", "Proj Key 4"]
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))}
Great! Got the job done.
Thanks a lot
It looks like you're new here. Sign in or register to get started.