/
Deleting items from checklists using SIL
Deleting items from checklists using SIL
You may want to remove some items from a checklist, but not all of them. This can be useful to filter out unnecessary items in a checklist.
To remove all items or reset a checklist, see Updating checklists with new sets of items using SIL instead.
Steps
Retrieve the current list of checklist items converted from JSON to the
oChecklistItem
structure.oChecklistItem[] items = fromJson(DoD);
Remove the targeted items from the collection.
for(oChecklistItem item in items) { // We only keep items that are named "Code reviewed" or are checked if (item.name != "Code reviewed" && !item.checked) { items -= item; } }
Update the custom field by passing it the newly created collection converted to JSON.
DoD = toJson(items);
Example
Here is a full example that can be used to remove all items with the “Not Applicable” status:
SERVER DOCUMENTATION (On Cloud? Go here.)
Have questions? Contact our Service Desk for help anytime.
, multiple selections available,
Related content
Checklist item representations
Checklist item representations
Read with this
Searching checklists
Searching checklists
Read with this
Updating checklists with new sets of items using SIL
Updating checklists with new sets of items using SIL
Read with this