I want to create a Escalation button in portal to escalate case . Can anyone help ?

priyankar umesh
Tera Contributor

My requirement is , after user submitted case from record producer , once the record producer is submitted they redirect to a page where they can track progress . In that page only I want to add a button once's pressed that specific case should be escalated . 

2 REPLIES 2

Yashsvi
Kilo Sage

Hi @priyankar umesh,

To create an escalation button in ServiceNow's portal to escalate a case, follow these steps:

1. Create a UI Action:
- Go to `System Definition > UI Actions`
- Click `New` and fill in:
- `Name`: Escalate Case
- `Table`: The table you want (e.g., `Incident`).
- `Action name`: escalate_case
- `Condition`: When to show the button (e.g., `current.state == 'open'`).

- `Script`: Add logic to escalate the case

 

(function executeAction() {
current.priority = 1; // Change priority
current.comments = 'Case escalated to high priority';
current.update();
})();

 

2. Add Button to Portal Widget:
- Go to `Service Portal > Widgets`.
- Select or create a widget.
- Add this button to the widget's HTML:

<button class="btn btn-danger" ng-click="escalateCase()">Escalate Case</button>

3. Add Client Script:
- In the widget's `Client Script` section, add:

 

function($scope, spUtil) {
$scope.escalateCase = function() {
var gr = new GlideRecord('incident');
gr.get($scope.data.sys_id);
if (gr) {
gr.escalate_case();
spUtil.addInfoMessage('Case has been escalated.');
} else {
spUtil.addErrorMessage('Error: Unable to escalate case.');
}
};
}

4. Test the Button:
- Open the Service Portal, navigate to a case, and click the "Escalate Case" button to verify functionality.

This will add an escalation button to your ServiceNow portal to escalate cases.

Thank you, please make helpful if you accept the solution.

priyankar umesh
Tera Contributor

My requirement is , after user submitted case from record producer , once the record producer is submitted they redirect to a page where they can track progress . In that page only I want to add a button once's pressed that specific case should be escalated .