Forums

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

Groovy script for project and scheme creation - how to?

Rumceisz
Contributor
June 21, 2015

Hi Everyone,

we use a plenty of Jelly scipts for easy project, permission scheme and notification scheme creation. Hence Jelly is not supported anymore from the next JIRA version, we need to change to Groovy. The problem is that we don't know Groovy and therefore I ask you whether you have already such scripts or script skeleton?

It would be great help for us!

 

Thanks in advance,
Rumi

1 answer

1 accepted

1 vote
Answer accepted
Alexej Geldt
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 21, 2015

basically it is not much different from java.
you inject JIRA components into the script and call their methods pretty much the same way you would do it in pure java. You can use ComponentManager or ComponentAccessor statically to inject JIRA components.

example creating a new project

import com.atlassian.jira.ComponentManager 
import com.atlassian.jira.project.ProjectManager

/* statically load project manager */
def projectManager = ComponentManager.getInstance().getProjectManager()

/* use project manager to create project */
projectManager.createProject(name,key,description,leadKey,url,assigneeType)

https://docs.atlassian.com/jira/latest/com/atlassian/jira/project/ProjectManager.html

Note: you may want to inject other JIRA components first to resolve parameters required to create desired projects and schemes. Follow JIRA docs.

Rumceisz
Contributor
June 22, 2015

Hi Alexej, thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira product discovery, product operations, product ops, linkedin live, atlassian events, cross-functional collaboration, product management, engineering collaboration, design collaboration, atlassian learning, agile teams, product strategy

Product Ops Unpacked: 4️⃣ tips every product pro needs to know ✍️

Join PM Evangelist, Axel Sooriah, & Product Ops. Consultant & Advisor, Jenny Wanger, as they unpack the role of product ops and discuss key takeaways in Atlassian’s ‘The Product Ops Mission’ guide. They’ll answer your questions live on May 6 at 9:00am PT.

Register here ⬇️
AUG Leaders

Atlassian Community Events