Script runner - Behavious - Field required

Raphaël Badertscher
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 17, 2019

Hello,

I have setted up a behaviour to make a field required based on another field like this:

import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours

def testableField = getFieldById(fieldChanged)
def testRemarksField = getFieldByName("test remarks")

testRemarksField.setRequired(testableField.getValue() == 'no')

If I edit a task with the testableField to no, I see that the field is required:

jira_tabs.png

And the field is also marked as required:

jira_field.png

But if I validate the form again, it won't ask again this field even if it's still empty. How is it possible?

0 answers

Suggest an answer

Log in or Sign up to answer