Forums

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

How to remove field required based on condition

Lakshmi CH
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.
November 15, 2019

Hi Team,

  How to remove the field required based on below condition. Could anyone please suggest me on this. Both are in same workflow.

If Requester Dept. = RFI, Type = Change Request, and Enablement = Yes, then do not require RI Consultant field.

-------------

Fields Required Validator (JMWE add-on)

I used below validator and working fine

The "RI Consultant" field is required when "Issue Type = Change Request" and "Requester Dept. = RFI"

This validation only applies if the following condition is true:

issue.getAsString("Issue Type") == "Change Request" && issue.getAsString("Requester Dept.") == "RFI"

Thanks!

1 answer

0 votes
Lakshmi CH
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.
November 17, 2019

and i am trying use below script in behaviors. 

 

change.PNG

Lakshmi CH
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.
November 17, 2019

and trying with this one also.

 

import com.atlassian.jira.issue.customfields.manager.OptionsManager

def requesterdeptcf = getFieldByName("RequesterDept")
def enablementcf = getFieldByName("Enablement")
def riconsultantcf = getFieldByName("RIConsultant")

def RequesterDept = requesterdeptcf.getValue() as Requester Dept.
def enablement = enablementcf.getValue() as Enablement

If ("Requester Dept." == "RFI" && "Enablement" == "Yes")
{
riconsultantcf.setRequired(false)
}

Suggest an answer

Log in or Sign up to answer