Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

field required for a given transition only if another field has a given value

Mani August 30, 2018

Hello All,

We have a field "Customer field"
We would like this field to be required when we move to Fixed state, only if another field     " Impact" = "Y"

I Tried the following in Validator:

Simple scripted validator (condition apply).
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.customfields.option.Option
import com.opensymphony.workflow.loader.StepDescriptor
import com.onresolve.jira.groovy.user.FormField

CustomField customField_name = customFieldManager.getCustomFieldObjectByName("CMS Description for Customer");

cfValues ['customField_name'] != ''

1 answer

0 votes
Payne
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 30, 2018

I would think something like this should work:

cfValues['Impact'] != 'Y' || cfValues['CMS Description for Customer'] != null

If Impact is N or empty, then all is good. If it is Y, then your other field must not be empty.

Suggest an answer

Log in or Sign up to answer