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.
@Ankit Jaiswal
Scriptrunner behaviours!!
Here's a guide
https://scriptrunner.adaptavist.com/5.6.8/jira/behaviours-overview.html
Thanks,
Pramodh
@Pramodh M
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.
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
Hi @Ankit Jaiswal
Let me know if you have tried this script and whether it's working?
It looks like you're new here. Sign in or register to get started.