Hi
I have encountered an issue with the workflow in ScriptRunner. I'm unsure about how to utilize the 'Transition' context variable. I've added this script as a validation rule in the 'Create' transition. However, when attempting to test the script, the console displays the following error: 'Evaluation failed: "transition" - identifier not available in context'.
Hey @jose de jesus torres torres ,
Can you share more about what you are trying to do etc?
You mentioned script as well, just based on what you have shared, not much info to look at:
error: 'Evaluation failed: "transition" - identifier not available in context'.
With ScriptRunner for Jira Cloud Validators, it would use Jira Expressions. There are some existing (Jira Expressions Examples ) on our page...but yeah.. not quite sure what you are trying to do to help.
Regards,
Sean
Hi Sean,
Well, I need to get the name of the target transition. Reading the JIRA documentation (https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference), I found the context variable type "transition", however I don´t know how to use it. This is my JIRA expression: transition.to.name == 'Analisis, Prototipado y Reglas de Negocio'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jose,
Validators and Conditions are quite similar with the only difference being:
So for your case, I am assuming that you are trying to validate that some requirement need to be met to be able to transition to "Analisis". The expression needs to be (true) to allow the transition, if it is (false) then you can't transition.
In that case, using the same require one linked issue example : issue.links.length > 0
If the issue has 1 (or more) linked issue, then the issue will be able to transition.
if the issue has 0 linked issue, then an error message will pop up.
I hope the explanation helps.
Regards,
Sean
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.