-
Notifications
You must be signed in to change notification settings - Fork 678
/
Copy pathScript_Include.js
37 lines (25 loc) · 975 Bytes
/
Script_Include.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var CreateMajorIncident = Class.create();
CreateMajorIncident.prototype = Object.extendsObject(AbstractAjaxProcessor, {
majorIncCreate: function() {
var incSysId = this.getParameter('sysparm_sysid');
var ginc = new GlideRecord('incident');
if (ginc.get(incSysId)) {
ginc.major_incident_state = 'proposed';
ginc.proposed_by = gs.getUserID();
ginc.proposed_on = new GlideDateTime();
ginc.work_notes = "Hello World! " + new GlideDateTime();
ginc.update();
return ginc.number.toString();
}
return 'false';
},
isAlreadyMajorIncident: function() {
var incSysId = this.getParameter('sysparm_sysid');
var ginc = new GlideRecord('incident');
if (ginc.get(incSysId)) {
return ginc.major_incident_state == 'proposed' ? 'true' : 'false';
}
return 'false';
},
type: 'CreateMajorIncident'
});