In order for ScriptRunner in Jira to update a field is it necessary that the custom field will be Associated in an edit screen or is it enough to have in in View screen?
When a field is only on a view screen, it won't appear in the issue type, even though it is shown in the configuration of this issue type. As long as the field is on the view screen only, the script will fail. However, once I add it to the edit screen, it works.
The problem is, I don't want this field to be editable.
Any ideas on what I should do?
Hi @Eran Roiter,
Have you tried leaving the field in the edit screen but using behaviors to make it read-only? The script should be something like this:
const customField = getFieldById("customfield_00000");
customField.setReadOnly(true);
Just replace "customfield_00000" with the actual custom field ID.
According to the ScriptRunner assistant, "The field will still be editable by other scripts. Setting setReadOnly(true)
only affects the user interface, making the field appear read-only to users. Scripts can still modify the field value using setValue
."
I hope it helps.
Cheers,
Melo
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.