Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to bulk change project type?

David A February 22, 2016

Hi

We are planning to migrate from JIRA 6 to JIRA Software.  We have 53 legacy projects that we wish to keep as type 'Business'. They will be converted to type 'Software' by default and then I will have set each one individually back to type 'Business'.

Can I change project types in bulk? Perhaps by running a script?

Best regards

David

1 answer

1 accepted

1 vote
Answer accepted
Boris Georgiev [Appfire]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2016

You can write a groovy script to update the project type using this API method

com.atlassian.jira.bc.project.ProjectService.updateProjectType(ApplicationUser, Project, ProjectTypeKey)

It could be something like:

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.bc.project.ProjectService;
import com.atlassian.jira.project.type.ProjectTypeKey
def type = new ProjectTypeKey("Business")//not sure about the exact type string
def ps = ComponentAccessor.getComponent(ProjectService.class)
def projectKeys = ["PI", "MTP", ....]
projectKeys.each(){p->
	ps.updateProjectType(user, ps.getProjectByKey(p),type); 
}
David A February 22, 2016

Thanks for your answer. Since I have 53 projects, it would be nice to populate list projectKeys programmatically. Do you know how I could do that please?

Boris Georgiev [Appfire]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2016

You can get them like this (of course then you need to filter some of them probably in case you don;t have to change the type of all projects):

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.project.ProjectManager;
def pm = ComponentAccessor.getComponent(ProjectManager.class)
pm.getProjectObjects().collect{$p-> 
$p.getKey()
}
David A February 22, 2016

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events