Hello, In Jira Server/Data Center we have Checklist plugin installed (okapya). We have a lot of automation based on ScriptRunner/Groovy: make custom fields read-only or hidden, select value or add new options into the select list custom field based on the value in the other custom field.
We also need possibility to manage Checklist behavior with help of ScriptRunner Behaviours on Create/Edit Screens.
Currently request which I got is very simple:
- Set several Checklist options "checked" based on the other custom field value on Create/Edit Screen.
- Also I need to make Checklist field read-only or writable based on the value of the other custom field on Create/Edit screen.
- Another request is to make all options in Checklist read-only except one particular option on Create/Edit screen.
I tried just simple case: created ScriptRunner Behavior to make Checklist field read-only, but it didn't work - checklist is still editable and I can check/uncheck options.

Some quick server-side script I tried in ScriptRunner Behavior for the Checklist custom field:
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
@WithPlugin("com.okapya.jira.checklist")
import com.okapya.jira.customfields.*
import com.okapya.jira.checklist.*
def checklistField = getFieldById(fieldChanged)
Collection<ChecklistItem> items = (Collection<ChecklistItem>) checkboxField.value
items.find(item -> item.getName() == "Help").setChecked(true)
But it doesn't work as well - fails with cast error:
Cannot cast object '{"name":"Help","checked":false,"mandatory":false,"globalItemId":56712,"statusId":"none","rank":6,"id":7,"dueDate":null,"isHeader":false,"priorityId":null,"assigneeIds":[],"version":"5.0","linkedIssueKey":null}' with class 'java.lang.String' to class 'java.util.Collection'
at 0e54872ceb9b5a6e59e4cdcbcb9a102e.run(0e54872ceb9b5a6e59e4cdcbcb9a102e.groovy:8)I went through the Checklist documentation https://okapya.atlassian.net/wiki/spaces/CHKDOC5/pages/3236659321/Getting+started+with+ScriptRunner and didn't find solutions to manage behavior of the Checklist on Create/Edit screen.
If you have good examples or documentation for my cases, please share.
Thanks in advance.
Checked in 2 different envs:
First instance:
Jira: v9.4.9
ScriptRunner: 8.9.0
Checklist: 6.2.4
Second instance:
Jira: v8.20.13
ScriptRunner: 8.1.0
Checklist: 6.2.4