Below is the script I have. Both fields are on the create screen but when I add the behavior and run a test nothing happens.
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
def SegmentField = getFieldById("customfield_12015")
def MerchantOwnerAreaField = getFieldById("customefield_13601")
String SegmentIssueValue = SegmentField.getValue()
if (SegmentIssueValue == "Merchant") {
MerchantOwnerAreaField.setRequired(true)
} else {
MerchantOwnerAreaField.setRequired(false)
}
when I run it in the script console it gives me the following error Cannot get property 'customfield_12015' on null object
I am new to all of this... can anyone tell me more about the import piece at the top? I feel that is why I am getting the error.
Any help would be greatly appreciated!!!
Hello @Brooke Anglin
Where did you place your script? This script in your behaviour must be attached to your customfield_12015. See screen bellow
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You re welcome! If this helps you please mark answer as accepted :)
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.