Hi,
I am not exactly a Groovy expert. Nevertheless, I am trying my hand at getting this to work. I have a field for users to provide a business justification for the selection of a certain oracle role. I only want the field oracleJust to pop up in the create screen when field oracleRole (a multi select list) is not empty.
I have a Behavior configured for the same field that is defined in my script as oracleRole, with an initializer function set as below:
import com.onresolve.jira.groovy.user.FormField
FormField oracleJust = getFieldById("customfield_17274")
oracleJust.setHidden(true)
And the inline script set as below:
import com.onresolve.jira.groovy.user.FormField
FormField oracleRole = getFieldById("customfield_10531")
FormField oracleJust = getFieldById("customfield_17274")
if (oracleRole.getFormValue() == "FIN-FA_Asset Inquiry") {
oracleJust.setHidden(false)
}
I have the behaviour mapped to the correct project. When I navigate to the create screen of that project, the initializer is doing it's job (oracleJust is hidden) but the inline is not. When I select a value from oracleRole, the dependent field is not showing. What am I doing wrong?
Where did you set the script under the line "And the inline script set as below"? Usually the answer is "log the value and result in your code":
log.warn "Log results (Hello mom!):\nOracle Role: ${oracleRole.getFormValue()}\nComparison results: ${oracleRole.getFormValue() == 'FIN-FA_Asset Inquiry'}"
I usually use the "toLowerCase()" String method as well, just to be a little easy going. :p
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.