...
To add items, retrieve the custom field value and then add the desired items to it:
Code Block | ||
---|---|---|
| ||
// Add an item to the Checklist def ArrayList<ChecklistItem> existingChecklistValue = (ArrayList<ChecklistItem>) issue.getCustomFieldValue(checklistCustomField); def newItem = checklistCustomFieldType.getSingularObjectFromString('{"name": "item name"}'); newItem.setRank(existingChecklistValue.size() + 1); existingChecklistValue.add(newItem); // Update the issue with the new checklist checklistCustomFieldType.updateValue(checklistCustomField, event.issue, newChecklistValue); |
...