Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Custom script listener to transition issues in a sprint

I am trying to move all the issues with Done status to Close status when a sprint is closed.

I have custom listener to perform the operation but the script didn't work.


I am not sure what's wrong with the script.

Any help on this would be greatly appreciated.


2 answers

1 accepted

1 vote
Answer accepted

For those who are looking to perform the same using Script Runner, here is the code that worked for me:


Hi @Stuti Golwala can you help please?

I changed your code a little bit to transition an issue when the sprint its started.

The logs shows this error.


error log.pngAnd this is my code.

my code.png

Thank you, 


Antoine Berry Community Leader Feb 04, 2020

Hi @Fabio Manzoni ,

line 27 replace

"issueID ->"


"issueId ->"

Hi @Antoine Berry

The error it's the same.


2020-02-05 11:24:05,918 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2020-02-05 11:24:05,918 ERROR [runner.AbstractScriptListener]: Script function failed on event:, file: null
groovy.lang.MissingPropertyException: No such property: actionId for class: Script1419
 at Script1419$_run_closure1.doCall(Script1419.groovy:30)

@Antoine Berry 


I changed the  actionID to actionId and not the issueId.

Thank you for your help


0 votes
Antoine Berry Community Leader Apr 04, 2019


Providing the logs would help debugging. Anyway I use a different approach that has been working fine, which would be (using your parameters) : 

import com.atlassian.jira.workflow.WorkflowTransitionUtil
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl
import com.atlassian.jira.util.JiraUtils

WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );


Hi Antoine,

Thank you for your reply.

From your code, will it move all issues or a particular issue to close status? Also, do I have to mention the issue id in the code? If yes, then I am afraid to use it as I don't want the issue to be static. 

I am sorry if I have not understood your code. This is my first groovy script.

Antoine Berry Community Leader Apr 05, 2019


You are welcome to ask any question !

If you are using a Script Listener, the script is triggering on the event(s) you are mapping to it.

Events are triggered in workflow (Issue created/Issue closed...) transitions. You can change which event is triggered in a transition, and you can create custom events.

There are also system events (Issue Assigned/Issue updated/Issue commented...). In previous cases you can use "issue" as your object, i.e. the issue on which the event is triggered - Sorry if you knew all this already.

So in your case I guess you are using the SprintClosedEvent event. I have never used it, but you can find an exemple here :

In this case your are gonna need to use the "event" object, to retrieve the sprint which has been closed. Once you have retrieved the issues that you want to update, you can use my script for each of them.

As this not very well documented, I would advise to use logs a lot to check objects values and their class (using .getClass()) to check the documentation, such as the sprint.

Good luck, very interested in the outcome. :)

Like # people like this

Hi Antoine,

Thank you for the detailed explanation. I will try to script and see what is comes out to.

I will surely post the solution here whenever I have it.

Thanks again!

Hey Antoine,

Forgot to attach the logs of my code that I have attached in my first post.

The following log information was produced by this execution. Use statements"...") to record logging information.

2019-04-05 19:04:31,708 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2019-04-05 19:04:31,710 ERROR [runner.AbstractScriptListener]: Script function failed on event:, file: <inline script>
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script89.groovy: 29: unable to resolve class IssueInputParametersImpl 
 @ line 29, column 95.
   rrentUser,, actionId,new IssueI
1 error
Antoine Berry Community Leader Apr 08, 2019

You are missing the class, use this import

import com.atlassian.jira.issue.IssueInputParametersImpl
Like Stuti Golwala likes this

Thank you Antoine for the catch.

I have added it but still getting an error.




Time (on server): Mon Apr 08 2019 09:19:07 GMT-0700 (Pacific Daylight Time)

The following log information was produced by this execution. Use statements"...") to record logging information.

2019-04-08 16:19:07,924 ERROR [runner.AbstractScriptListener]: *************************************************************************************
2019-04-08 16:19:07,924 ERROR [runner.AbstractScriptListener]: Script function failed on event:, file: <inline script>
groovy.lang.MissingPropertyException: No such property: issue for class:

I have added the library "" but still failing the execution.

Not sure what to add/remove.


The problem seems to be that your "issue" object is null. I would advise to log the objects you are creating so you can see what is working and what is not. Example after line 15 : 

log.error("issue : " + issue)

In this particular case since you are triggering a Sprint Closed event, the listener is bound to the Sprint object and not the issue, that is why your issue is null (That is what I would assume since I have not tried using this particular event).



returns null. That is my guess. You need to retrieve the issues from the sprint object (event.sprint) as in the example provided by scriptrunner.


Makes sense to me.

I will try it out.


I have found a solution to it. Posting the code soon.

Hi, Dear Stuti, do you have found a solution?

Suggest an answer

Log in or Sign up to answer

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you