Hi!
I want to create behaviour and I'm struggling with condition based on label field. Does anyone have an example how to use label field in behaviour condition. In my case if label field will match with value then description field should be pre-filled.
Regards,
Seba
Hello @Sebastian Krzewiński ,
I hope you are doing well.
I don’t have the app available to test right now, but please let me know if this works:
(Replace the label name EXAMPLE with the one you need.)
def labelsField = getFieldByName("Labels")
def descriptionField = getFieldByName("Description")
def labels = labelsField.getValue() as List<String>
// reset requirement by default
descriptionField.setRequired(false)
if (labels && labels.contains("EXAMPLE")) {
descriptionField.setRequired(true)
}
Resources: ScriptRunner for Cloud Behaviours API
Best regards,
Izabela França
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.