This documentation is for version 4.x. For the latest documentation, click here
Update a checklist using the Issue Manager
So far, all the provided examples were using the custom field type to update the checklist. However, this method will not dispatch any Issue Updated
event and will not write change logs. If you wish to do a fully integrated issue update, you need to use the Issue Manager.
Be careful, using the Issue Manager inside an event listener will cause an infinite loop! Fortunately Jira will stop the loop at one point.
First, you need get a hold of the Issue Manager.
import com.atlassian.jira.component.ComponentAccessor;
def issueManager = ComponentAccessor.getIssueManager();
You then update the checklist data in the issue.
issue.setCustomFieldValue(checklistCustomField, existingChecklistValue.toList());
And finally use the Issue Manager to finish the job.
import com.atlassian.jira.event.type.EventDispatchOption;
issueManager.updateIssue(event.user, issue, EventDispatchOption.ISSUE_UPDATED, false);
Following is a complete example that uses the Issue Manager: