Skip to content

Commit d2ec8cd

Browse files
authored
Set incident as critical priority (#1073)
* Create script.js This UI Action script sets current incident record as priority as Critical. * Create readme.md Readme file
1 parent d5b4592 commit d2ec8cd

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Set Incident Priority Critical
2+
3+
This UI Action sets current incident record as priority as Critical.
4+
5+
When clicked
6+
Below Conformation message will be displayed to the user as below
7+
"Are you sure you want to set priority as Critical?"
8+
9+
If user selects cancel nothing will happen.
10+
11+
If user selects confirm then
12+
a) It sets the Priority of the current Record as 1-Critical by setting Urgency and Impact as 1-High.
13+
b) It also sets 'assigned_to' field as 'logedin user'.
14+
c) It also upends the description as "Priority is set to Critical by 'logedin User'".
15+
16+
** Please note that it changes field values only on the form that is client side.
17+
Unless you submit or update the record, field values will not be updated in the database table records.
18+
19+
You can use this as reference to set other field values as well.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Call this function from OnClick field of UI Action form
2+
function ClientSideScript() {
3+
var answer = confirm("Are you sure you want to set priority as Critical?");
4+
if (answer == true) {
5+
g_form.setValue('assigned_to', g_user.userID);
6+
g_form.setValue('impact', 1);
7+
g_form.setValue('urgency', 1);
8+
g_form.setValue('description', g_form.getValue('description') + "\nPriority is set to Critical by " + g_user.getFullName());
9+
}

0 commit comments

Comments
 (0)