Hi I am trying to create a behaviour to show a custom field based on component value.
I have read the previous helpful articles and have the following script
def comp = getFieldById(COMPONENTS)
def values = comp.getValue()*.getName()
def tatr = getFieldById('customfield_14310')
tatr.setHidden(true)
if(values.toString().contains("test"))
{
tatr.setHidden(false)
}
This shows a spread operator error on line 2 (def values) and hides the custom field no matter what.
Can someone give me a hint what could be wrong?
Thanks
This is the expected behavior.
Behaviours can't execute based on In-line edits.
Historically, in-line edits were always disabled and attempting to in-line edit would cause the full edit screen to open so that the Behaviour logic could execute as expected.
The setAllowInlineEdit was added at some point to bypass that default behavior for cases where the business wants to allow those changes despite the logic being bypassed.
If you look at this example: https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-examples/scripted-conditions
You can see that the inline edit is only enabled in the case of a user being an admin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.