You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I know how to assign a permission scheme of a Template Project to another Project:
import org.springframework.stereotype.Component;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.workflow.AssignableWorkflowScheme;
import com.atlassian.jira.workflow.DraftWorkflowScheme;
import com.atlassian.jira.workflow.JiraWorkflow;
import com.atlassian.jira.workflow.WorkflowScheme;
import com.atlassian.jira.workflow.WorkflowSchemeManager;
def projectDefault = ComponentAccessor.getProjectManager().getProjectObjByKey("DPDefault");
def projectNeu = ComponentAccessor.getProjectManager().getProjectObjByKey("DPNeu");
ComponentAccessor.getWorkflowSchemeManager().removeSchemesFromProject(projectNeu);
ComponentAccessor.getWorkflowSchemeManager().addSchemeToProject(projectNeu, ComponentAccessor.getWorkflowSchemeManager().getSchemeFor(projectDefault));
But how do I do this to every single project of a project category? Or do I really need to change the permission scheme for each project in it? Thanks!
Hi @Sngy ,
Below code snippet may give you some idea, I didn't test this in my server though
import com.atlassian.jira.component.ComponentAccessor
def prcat = ComponentAccessor.getProjectManager().getProjectCategoryObjectByName("Code/Scriptrunner")
def prList = ComponentAccessor.getProjectManager().getProjectsFromProjectCategory(prcat)
prList.each{ proj ->
//code here
}
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.