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 defaultdescriptionField.setRequired(false)
if (labels && labels.contains("EXAMPLE")) {descriptionField.setRequired(true)}
Resources: ScriptRunner for Cloud Behaviours API
Best regards,
Izabela França
It looks like you're new here. Sign in or register to get started.