Wrote the code as a post function on the workflow. Its supposed to be a simple check of the parents Status. If the status matches then it should return true and execute.
For some reason I can't even get passed the issue class. I tried running in Scriptrunner Console but get an error on the issue class. Here is the code:
import com.atlassian.jira.issue.Issue
Issue issue = issue
if(issue.parentObject.status.name == "To Do" || issue.parentObject.status.name == "Refinement" || issue.parentObject.status.name == "Ready to Work")
{
return(true);
}
else
{
return(false);
}
Error
No such property: issue for class: Script263
groovy.lang.MissingPropertyException: No such property: issue for class: Script263
at Script263.run(Script263.groovy:2)
Hello,
Sorry for such a late reply on this!
You shouldn't need to define issue for a post function. Try just doing:
if(issue.parentObject.status.name == "To Do" || issue.parentObject.status.name == "Refinement" || issue.parentObject.status.name == "Ready to Work")
{
return(true);
}
else
{
return(false);
}
As far as running this in the Script Console, you need to define what issue your trying to run the script on there. You can use a method from the IssueManager class to get an issue by it's key and then run a script in the console off of that.
Please let me know if this works for you, or if you have any other questions. :)
Jenna
Still not working, we added a Groovy post function "Transition current issue's parent issue. " on the "Working" Transition step. The idea is to have the issues Parent move to "Working" Status only if its current status is in Refinement, ready to work or To do. in the post function we added the code above. When we move a sub task to the "Working" step the Parent issue does not change.
Any thoughts?
Thank you.
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.