Hi, I'm trying to set up a validation in a workflow that requires the URL field [RCA] to be filled when closing a ticket, but only when the radio button field [RCA requested] has the value "Yes".
Can someone tell me what I'm doing wrong here? Instead of only requiring [RCA] under that condition the field is always required, even if it has a value. Alternately should I use the JWT logical validator?
Thanks!
import com.atlassian.jira.issue.customfields.option.Option
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("RCA requested")
cfValues['RCA requested']?.value != 'Yes' || cfValues['RCA']
Hey @Alex Smith
I just wanted to get back to you to explain the identical implementation with Jira Workflow Toolbox's Logical Validator. The choice of the validator would be the right one. 😁 👍🏼
The expression is written just as quickly:
%{issue.cfAAAAA} = "Yes" IMPLIES %{issue.cfBBBBB} != null
With the checkbox checked and no URL, the query will return false. The validator returns true in any other case (both fields are empty or URL filled without the checkbox). Have fun enhancing your workflows! :)
Best, Max
Hi @Max Foerster - K15t thank you so much! That's perfect, as we do have JWT. I simply couldn't figure out the syntax
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alex Smith
I've used the following code to one of my project and it worked:
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectsByName("NDA")
cfValues['NDA']?.value != 'Signed' || cfValues['NDA link']
Replace NDA with your single select field and the NDA link field with your RCA link. The condition worked when NDA was equal to "signed" (your "Yes), and I couldn't proceed to the next transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interestingly that only partially worked, at it was only successful when I set the radio button field [RCA requested] as == instead of != (which makes little to no sense). But then it required the URL field [RCA] whether the field value was "Yes" or it was empty. Maybe I need to add a second value to [RCA requested] and make it required no matter what.
cfValues['NDA']?.value == 'RCA requested'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My apologies, [RCA requested] is a checkbox field instead of radio buttons. Any suggestions if that might be causing the issue? Ultimately the field can either have the value "Yes" or it can be empty, and I only want the URL field [RCA] required when the value filled in with the only option of "Yes". Thanks.
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.