I have a workflow with the statuses: Done and Closed.
I want issues to move automatically from Done to Closed status when the sprint is closed.
I have added Script Runner and created Script Listeners - Fast-track transition an issue
Project Key: Selected the project name
Events: SprintClosedEvent
Condition: issue.status.name == 'Done'
Action: Closed(71), where 71 is the ID of the worklflow that will be applied to the issue
Checked Skip Permissions, Skip Validators, Skip Conditions in Transition Options.
When I preview it, I get following under Result tab:
Fast-track transition an issue (condition apply).
Action: Closed (71) will be applied
Note that this should go after the Fire Event function.
When I closed the sprint, I got following error:
Script function failed on event: com.atlassian.greenhopper.api.events.sprint.SprintClosedEvent, script: com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition
Assertion failed:
assert issue // issue in doScript
|
null
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition.doScript(FasttrackTransition.groovy:108)
I am not sure about the next step.
Any help is greatly appreciated.
Thanks!
I have found a solution to my script. Here is the code:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please help me with solving the issue.
I have looked at the community answers and found a couple of different scripts and events. I tried to merge them and create a custom listener to move issues from done to close status when sprint is closed.
The script is running into some errors. Here are the logs:
The following log information was produced by this execution. Use statements like:log.info("...") 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: com.atlassian.greenhopper.api.events.sprint.SprintClosedEvent, file: <inline script> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script89.groovy: 29: unable to resolve class IssueInputParametersImpl @ line 29, column 95. rrentUser, issue.id, actionId,new IssueI ^ 1 error
Can you let me know from the logs if there is anything that I am missing or I need to change anything?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
According to Adaptavist support, I need to create a custom listener.
I did create, but it is still not working. Any help on it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stuti,
How are you?
I understand that you are trying to automatically transition all the issues in the done status to Closed when you complete the Sprint they belong to. Is that correct?
I'm not sure why this error is happening for you on Scriptrunner, however, I would like to suggest you a different plugin to easily achieve this goal: Automation for JIRA
Since the Automation rule would only be triggered when you close a Sprint, I believe you will not consume more than the 300 free executions per month, so you will not have any costs on it.
This would be the rule:
P.S: In the example above, I used the statuses "In progress" and "Done" since they were the ones available in my test instance.
Let me know if this option helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Petterson,
Thank you for suggesting an option to go with Automation for Jira.
I am not clear when you mentioned: "I believe you will not consume more than the 300 free executions per month, so you will not have any costs on it."
Do you mean that the add on will be free if it is not executed for more than 300 executions per month?
We have 6000 Jira Enterprise licenses.
Also, it would be great if you can suggest some solution that is related to ScriptRunner.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Stuti,
The Automation for JIRA plugin has 300 free executions per month, so you will be charged if you exceed that number.
I was meaning that since the rule would only be executed when you complete a Sprint, I believe this app would not have any costs for you unless you complete more than 300 Sprints in a month.
About the Scriptrunner solution, I have added the Scriptrunner tag to this issue so the Adaptavist team can check it and may give you any insights.
Let me know if you still have any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Petterson,
Thank you for your confirmation.
Will look at the add on and circle back to you if I have any further questions.
Thank you once again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome, Stuti.
Feel free to contact us on this thread as many time as you want and we will work to get your question answered. :)
In advance, have a nice weekend!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.