If the condition is false I need to set a message into a customfield that is fieldtype single line text field.
below is the code I have for the customfield
def cf2 = ComponentAccessor.getCustomFieldManager().getCustomFieldObjects ByName('Transition Blocker')
In the condition it does not allow me to
get the custom field value and then getFieldByID and set the FormValue or per documentation do
cf2.setError ("this is it)
else
cf2.clearError()
Using script runner version 7.8.0
Hi @Nannette Mori ,
first of all workflow condition defines if a transition button should appear or not. Based on that there's no way to set an error. If you need that, my suggestion is to use a workflow validator instead.
Hope this helps,
Fabio
https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-examples/scripted-conditions
Per that document I was lead to believe you could
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We don't want the transition button to display but we also want the users to know why
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How do you check on the condition that was created in the workflow in the validator?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nannette Mori , if you use behaviour you can just put the error on your field using the following code :
def cf2 = getFieldByName("Transition Blocker")
cf2.setError ("this is it)
This should fix your issue. You don't need to take cf through CustomFieldManager.
Fabio
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.