Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner Cloud Behaviours - condition based on label field

Sebastian Krzewiński
Community Champion
September 23, 2025

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

1 answer

0 votes
Izabela França
Community Champion
September 23, 2025

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events