- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 12:45 AM
How to create a new UI Action named Cancel Incidents which works as a List banner button to cancel multiple selected incidents?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 01:51 AM
Ah, sorry I mentioned the wrong checkbox.
It should be List Choice, not List Context Menu.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 12:56 AM
check the link below
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 12:59 AM - edited ‎09-27-2023 01:52 AM
Hi @Shwetha Shenoy,
Create a UI action with List Choice checked.
Use the following script (and adjust per your use case):
// Get the current incident state.
var state = current.getValue('state');
// Check if the incident is in a cancelable state.
if (state === '1' || state === '2') {
// Set the incident state to canceled.
current.setValue('state', '3');
// Add a comment to the incident record indicating that it was canceled.
current.addComment('Incident canceled at ' + gs.nowDateTime());
// Update the incident record.
current.update();
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 01:41 AM
This works only for a single incident ticket in a list view but not for multiple incidents.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2023 01:43 AM
Hi @Shwetha Shenoy,
No, this works for multiple (when using the checkboxes).
Indeed it does not work based on your current query for example.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.