How to get Issue Status using groovy

How to get current Status of Issue Type using groovy and gather the list of linked status for the ticket.

Can anybody help me out with this?

2 answers

to get current status of issue


to get available actions for the issue

IssueWorkflowManager issueWorkflowManager = ComponentAccessor

Collection<ActionDescriptor> actions = issueWorkflowManager

Thanks , I am able to get the name. But to get available issue i am getting several errors.

Also now i want to set status of the current issue to some status like closed, so how can i do that?

what is the error messages you are getting?

The script failed : javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: issueWorkflowManager for class: com.onresolve.jira.groovy.Script149

how you are getting issueWorkflowManager ?

i have updated answer check now

Also i need to set status of current issue, say from X to Y, how can i do that?

For previous example, I have defined def issueWorkflowManager, but still its throwing error.

Thanks a lot, I got it now, now i am able to get all the status.

now i want to set status, such that i jump to that status on transition, So i have written this peice of code, but i guess its not working , So can you help me out with this?


workflowTransitionUtil.setAction (5)


is there any mandatory fields on that transitions?

Remember - you can NOT just "set a status".

Status is NOT a field, it is an indicator of where the issue is in the workflow. To change status, you MUST move the issue through transitions to the new status.

The only time you can "set" a status without transition is when you are adding issues to Jira.

When I am setting Action ID (20) for eg. I am getting switched to that transition but status remains the same. So what can be wrong?

@ rambanam : Yes there are mandatory fields like time and Comment.

@Nic Brough : But i can change the transition rgt? & when transition is done the status gets updated rgt?

@akash, don't forgot to voteup/like/accept as answers if anything helped to you

@Nic Brough : Now what if i want to move from A to C, auto Transition to C . For some time i don't want status B. I know th eobvious answer would be o create transition but i need to do it in groovy way.

>But i can change the transition rgt?

To try to clarify: You can NOT "change the transition". A transition moves an issue through the workflow. To change the status of an issue, you MUST use a transtion that goes from your old status to the new status.

> & when transition is done the status gets updated rgt?

Correct, because the whole point of a transition is that it changes the status.

No. You are not grasping this.

To change a status, you must use a transition

You cannot get around this. Groovy can tell Jira to do these transtitions. You can detect and automate them. You can protect them so that only certain users or automation can perform them and no-one else sees them.

But. You must have a transtion from A to C if you want to change status from A to C.

Unless you're happy to go from A to B to C, in which case you need transitions from A to B and from B to C.

It's not "the obvious answer", it is the "only answer". You must have that transition.

Yes, I have a transition from A -> B and from B-> C, So now can you tell me the way to do transition.


can we print the version detail of current issue into a text file  by using groovy script ?

please help me

Thanks & regards 

Naidu .l 

Please see the answer to your previous question at

Deprecated : 



The following will work: [as of Oct 2018]


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


244 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you