Hi Community,
as before, in many places I used this side script to make a connection between two or more fields or their dependency, but now I noticed that this script works exclusively and only for system admins and normal users, there are no required restrictions in this script at all. I don't understand how and why it happened at all? Can I help a little?
Best regards
def regulatoryRequirementNew = getFieldByName('Regulatory Requirement New')
def regulatorischeAnforderungen = getFieldByName('regulatorische Anforderungen')
def endDate = getFieldByName('End Date')
String regulatoryRequirementNewValue = regulatoryRequirementNew.getValue()
if(!regulatoryRequirementNewValue.startsWith("Keine Auswahl")){
regulatorischeAnforderungen.setRequired(true)
endDate.setRequired(true)
} else {
regulatorischeAnforderungen.setRequired(false)
endDate.setRequired(false)
}
Problem was that objectnames and getFieldbyName have a problem coz not all Users user same language in Jira. This solved my problems:
import com.onresolve.jira.groovy.user.FormField
def regulatoryRequirementNew = getFieldById("customfield_16100")
FormField endDate = getFieldById("customfield_13651")
FormField regulatorischeAnforderungen = getFieldById("customfield_13203")
String regulatoryRequirementNewValue = (String) regulatoryRequirementNew.getValue()
if(!regulatoryRequirementNewValue.equals("Keine Auswahl")){
regulatorischeAnforderungen.setRequired(true)
endDate.setRequired(true)
} else {
regulatorischeAnforderungen.setRequired(false)
endDate.setRequired(false)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.