Hello,
Once the project has been created - is there any way I can copy the configuration of an existing project to the one that has been created(the new one)? I am working on v8.5.1
Is there any plugin available or can it be done by any default feature available except for using Shared project Configuration?
Regards
Priyanka
Hi @Priyanka,
ScriptRunner plugin provides "Copy Project" option during new project creation. it works just like as Shared project configuration along with that you can copy Board, releases, component/s, etc...
If you want to copy schemes after creation, you can write custom groovy script to update them
BR,
Leo
Hello @Leo
Thank you for your reply but the issue is that we already have a template and the project is created using this template from backend, so we can not touch it. Once the project is created we need to configure it manually or rather copy the configuration from one project to another. how can this be avoided?
Regards
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Priyanka,
I recently did a small script to change Permission scheme, if you modify that script to modify other schemes too, you can achieve your requirement
Hope this gives you some idea
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.project.AssigneeTypes
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.util.SimpleErrorCollection
import com.atlassian.jira.mail.Email
import com.atlassian.mail.server.SMTPMailServer
//Input needs here
def projects = ["LTP","LT","LEET"] // Projects Keys list to change schemes
String permission = "Permission Scheme" //Update permission scheme available in the current server
def errorCollection = new SimpleErrorCollection();
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def leadkey = currentUser.getKey()
def permissionScheme = null
try{
permissionScheme = ComponentAccessor.getPermissionSchemeManager().getSchemeObject(permission)
}catch(Exception e){
log.debug(e)
preData = "Invalid Permission Scheme to Move further on Archival"
}
if(permissionScheme){
projects.each{ pro ->
def project = null
try{
project = ComponentAccessor.getProjectManager().getProjectObjByKey(pro)
}catch(Exception e){
log.debug(e)
}
if(project){
//Removing current scheme to avoid some technical issuses
ComponentAccessor.getPermissionSchemeManager().removeSchemesFromProject(project)
//Mapping permission scheme
ComponentAccessor.getPermissionSchemeManager().addSchemeToProject(project, permissionScheme)
log.info("Updated details successfully $project.key")
}
}
}
You can run this script in Script Console or if you want to automate this process for project creation event listener would be best choice
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.