I have a fairly simple script that sets fields visible on the condition of another radio button field. It is implemented twice, once on issue Create and a second on View or Edit.
The one script works on issue Create, as designed. The second script runs on View or Edit but the fields are not hidden. I assume the setVisible Method is either not working properly or is getting overridden by some background Jira process.
The code between the two scripts is identical in my implementation. The Behaviour logs show the various logger.info statements reached so the script is triggered and runs. All fields that should be hidden are shown though.
Adding a twist, the broken script actually worked for a few days and then just stopped working. Our IT dept said nothing in our Staging Jira has changed. A boiled down version of the script:
This was actually a bug between ScriptRunner and Jira cloud confirmed by Adaptavist. This has been resolved with recent App and Cloud updates.
Hi Adam,
If you want to make a value visible for a field when a value changes then you need to use the onChange trigger and use the getChangedField() function.
I can confirm that the example script here gives an example of how to make a field visible when a value is selected in a select list field, and you will be able to use this as a reference to help create the script that you require.
Regards,
Kristian
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.