Forums

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

How to Create a Project from within Java Code in JIRA?

Tanner Reese June 27, 2018

Hello,

Within a java class in a jira plugin, what classes and methods do you call to create a project? I already have access to the name of the project and project lead username.

I had been trying to use the ProjectManager createProject and the ProjectCreationData and ProjectCreationData.Builder classes, but the former was throwing Illegal State Exceptions. I assume the exceptions were the result of insufficient fields, but I'm not sure which ones. If this is the case what fields of the ProjectCreationData class must be filled and with what?

I have also seen people mention using the ProjectService class for this purpose, however, I'm not sure as to how to obtain an instance of this class.

1 answer

1 accepted

1 vote
Answer accepted
Alexey Matveev
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.
June 27, 2018

Hello,

You can find an answer to your question here:

https://community.atlassian.com/t5/Jira-questions/How-to-create-a-project-in-JIRA-using-java-api-and-scriptrunner/qaq-p/597331

You can get the ProjectService like this:

def static projectService = ComponentAccessor.getComponent(ProjectService)

Suggest an answer

Log in or Sign up to answer