I am trying to bulk rename multiple jira projects. I have a list of current and the new name in a sheet. I am using the following script and it runs perfectly.
I do not know how to run it in a loop so that it picks each item from the old project name column of the excel and updates it with the name in new column in excel.
Here is the code that I am using:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.project.UpdateProjectParameters
import org.apache.log4j.Level
import org.apache.log4j.Logger
def projectManager = ComponentAccessor.getProjectManager()
def project = projectManager.getProjectObjByName("Old project name")
if(project) {
def updateProjectParameters = UpdateProjectParameters.forProject(project.id).name("New project name")
projectManager.updateProject(updateProjectParameters)
}
else {
log.debug("Oops, project is unavailable")
}
Also, based on the code,
I created a single groovy script
that can rename multiple projects by uploading a csv with old and new project names.
Hope this helps anyone who is blocked with the same issue.
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot @Ravi Sagar _Sparxsys_ in fact my initial script is based on your you tube tutorials. Kudos for creating such helpful content.
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.