/
Update a checklist with a new set of items
This documentation is for version 4.x. For the latest documentation, click here
Update a checklist with a new set of items
A common use-case is to clear the checklist’s current content and build it from the ground up
First, you will need to create an empty collection (ArrayList<ChecklistItem
) that will contain the new items.
def ArrayList<ChecklistItem> newChecklistValue = new ArrayList<ChecklistItem>();
You then create an item and add it to the collection.
def item = checklistCustomFieldType.getSingularObjectFromString('{"name": "item name"}');
newChecklistValue.add(item);
Finally, you update the custom field passing it the newly created collection.
checklistCustomFieldType.updateValue(checklistCustomField, event.issue, newChecklistValue);
Following is a complete example that can be used to update a checklist with a new set of items:
, multiple selections available,
Related content
Create checklist items using "getSingularObjectFromString"
Create checklist items using "getSingularObjectFromString"
Read with this
Remove items from a checklist
Remove items from a checklist
Read with this
Validate a Checklist
Validate a Checklist
Read with this
Searching for Checklists
Searching for Checklists
Read with this
Converting Checkboxes fields to Checklist fields using ScriptRunner
Converting Checkboxes fields to Checklist fields using ScriptRunner
Read with this
Adding a Checklist Field to JIRA
Adding a Checklist Field to JIRA
Read with this