ScriptRunner Behaviours with Tree CF
When I try to use any scripting with a Tree field I get only null (for example formField.getValue()) Is there a way to use these to apps together?
Comments (12)
-
repo owner -
I do the same thing but not in Initializer - inside server-side script of the tree field.
I want to catch every change done in the tree field and put values into a plain multi-string field. Apparently it only works if values already set previously (that’s why you can reach them through initializer)
-
So, I’ve checked and unfortunately it’s true, TreeField wouldn’t trigger fieldChanged event((( Could that be fixed?
-
repo owner - attached tree-customfield-4.0.11.jar
I added call a 'change' event after user has set value. Try 4.0.11 version from attach
-
Hi Yuri,
the version you’ve attached does fire the change event when you add a value, hovewer removing the value doesn’t.I made that conclusion by testing following code
//def reqType = getFieldByName("Requirement Type").value def reqType = getFieldByName("Attribute/Function - New").getValue() as String def softTimer = getFieldByName("Soft Timer") def systemResponse = getFieldByName("System Response") int tabIndex if (issueContext.projectObject.key in ["LIB","REQ", "SDSE"]){ tabIndex = 2 } else { tabIndex = 3 } //if (reqType == "Fault Monitor"){ //if (reqType.contains("Fault Monitoring & Response")){ if (reqType && reqType.contains("339")){ showTab(tabIndex) systemResponse.setRequired(true) softTimer.setRequired(systemResponse.value == "PARK_ASAP") } else { systemResponse.setRequired(false) softTimer.setRequired(false) hideTab(tabIndex) }
When I set value 339 in my Tree field, the behaviour shows tab
When I remove it - it doesn’t hide it
If I set other value - it does hide it
-
repo owner You are using single choice or multiple?
-
Multiple
-
repo owner I think a problem in this:
def reqType = getFieldByName("Attribute/Function - New").getValue() as String
this is not String it’s List, see attached below
trigger “change“ fired on change value always
-
repo owner - attached Peek_2020-09-02_15-33.mp4
-
4.0.11.jar helped with my original issue, though I’ve discovered a new one
-
repo owner New version available on marketplace
-
repo owner - changed status to closed
- Log in to comment
Hi. Can you provide more info what you do? I can’t reproduce it