Forums

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

How can I create a new status with groovy?

Deleted user March 31, 2018

When importing workflows (XML) from other instances all of the instance specific statuses in the workflow are missing. I have then to manually recreate them. Is there a way to create statuses with groovy scripts?

 

I would then create the specific statuses first, get their IDs and add them to the xml workflows to import.

 

 

 

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.
April 2, 2018

You can try like this

import com.atlassian.jira.config.StatusManager
import com.atlassian.jira.component.ComponentAccessor

def statusManager = ComponentAccessor.getComponent(StatusManager.class)
def status = statusManager.createStatus("statusname", "Status Name", "/images/icons/statuses/inprogress.png")
log.error(status)
Deleted user April 2, 2018

Thanks Alexey, works perfectly!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events