UI Actions

Shwetha Shenoy
Tera Expert

How to create a new UI Action named Cancel Incidents which works as a List banner button to cancel multiple selected incidents?

1 ACCEPTED SOLUTION

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.

View solution in original post

16 REPLIES 16

Peter Bodelier
Giga Sage

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.

Hi @Peter Bodelier 

This works only for a single incident ticket in a list view but not for multiple incidents.

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.