I need to change statut based on component choose . on create i want to verify the component choose and set the next statut
Hello,
you find the answer here:
https://community.atlassian.com/t5/Answers-Developer-Questions/Scriptrunner-transition-next-step/qaq-p/517722#M55378
You can only set the next status, if there is a valid transition step.
I need to verify component choose and before that change the status to Open Or Need approval how can i do it ?
You get the current components with:
currComponents = issue.getComponents()
Then you can build a loop to check if your desired components would have been chosen:
for (c in currentComponents) { if (c.getName() == component) { DoSomething() } }
There you can perform the desired workflow transition and then use break to leave the loop. The following logic depends on your needs.
You can find the JIRA API for your version here:
https://docs.atlassian.com/jira/
There you find all classes and methods. Valuable information on the script runner can be found here: https://scriptrunner.adaptavist.com/latest/jira/quickstart.html
I hope you can get your code together. If not, feel free to ask again.
but how to set the next status ???
It looks like you're new here. Sign in or register to get started.