Standard Ticket Header Widget 'Actions' cancel option
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 11:15 AM
Standard Ticket Header Widget 'Actions'
1.cancel option available when incident state is new, inprogress
2.when selecting cancel option
a. Confirmation pop up asking cancelling reason
b. if provide the reason that reason should be in incident comments
Labels:
- Labels:
-
Employee Service Center
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2025 07:23 AM
1: Show a Modal When “Cancel” Is Clicked
$scope.cancel = function () {
spModal.open({
title: "Cancel Incident",
message: "Please provide a reason for cancelling this incident:",
input: true, // enables text input
value: "", // default value
size: "md"
}).then(function (result) {
if (result.button === "ok" && result.inputValue) {
$scope.data.action = "cancel";
$scope.data.cancel_reason = result.inputValue;
$scope.server.update(init);
}
});
};
2: Modify the Server Script to Accept cancel_reason
In your server script, update this block:
if (input && input.action == 'cancel' && incidentGr.get(incidentSysId)) {
incidentGr.incident_state = global.IncidentState.CLOSED;
incidentGr.state = global.IncidentState.CLOSED;
if (input.cancel_reason) {
incidentGr.comments = "Cancelled by user. Reason: " + input.cancel_reason;
} else {
incidentGr.comments = "Cancelled by user.";
}
incidentGr.update();
}