I have a use case.
There is a custom field as Change Result (with values "successful with errors" and "Failed" )
If the value in this field is "Failed"
Then I want to show a new field below this field as "Reason for failure" as a text field.
Scriptrunner behaviours!!
Here's a guide
https://scriptrunner.adaptavist.com/5.6.8/jira/behaviours-overview.html
Thanks,
Pramodh
I am new to scriptrunner. Can you send me the script for this use case.
I just want to put a condition on this new field "Reason for Failure"
The condition will be if the "Change Result" value is "Successful with errors" then this new field will be hidden.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's an example
def change_result = getFieldById(getFieldChanged()).getValue().toString()
if ( change_result == "Failed") {
getFieldById("customfield_10301").setHidden(false);
getFieldById("customfield_10301").setRequired(true);
}
else {
getFieldById("customfield_10301").setHidden(true);
getFieldById("custom field_10301").setRequired(false);
}
"customfield_10301" id is the id of the "Reason for failure" text field
Replace only the ID
You can get that when you edit the custom field, it will be visible in the URL
Let me know if you have any queries
Thanks,
Pramodh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Let me know if you have tried this script and whether it's working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the behaviours you need to add the field that you would like to hide/show or the field that the code is based on?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.