Hi,
I want to configure a behaviour on the resolution field that makes another field (ListTest) visible and required when the resolution of 'Rejected' is chosen. Here is my script that is currently not hiding the field nor making it required.
Please see script below and I have also attached the behaviour confg i am using...
import com.atlassian.jira.issue.resolution.Resolution
def resolutionField = getFieldById("resolution")
def listField = getFieldById("ListTest")
def resolution = resolutionField.getValue() as Resolution
if (resolution.name == "Rejected") {
listField.setRequired(true)
listField.setHidden(false)
} else {
listField.setRequired(false)
listField.setHidden(true)
}
Can anyone suggest what I am missing? Thanks
Hi Stephen,
I haven't tested your code in my own instance, but just by looking at it, I believe that you might need to change the line:
def listField = getFieldById("ListTest")
to this:
def listField = getFieldByName("ListTest")
Again, I haven't tested it in my instance, but I believe that "ListTest" is a custom field name. System fields are gotten by their ID like you have in the line above, but to use the name of a custom field, you'll need to change the way you get it!
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.