Skip to content

Commit fdd93af

Browse files
authored
Create IncidentDetails.js
This file contains a script include to get the values of incident record fields.
1 parent 1b5b6b3 commit fdd93af

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//Script include to get the values of incident record fields
2+
var IncidentDetails = Class.create();
3+
IncidentDetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
4+
5+
getIncidentDetails: function() {
6+
var inc = this.getParameter('sysparm_incidentSysId');
7+
var result = {};
8+
9+
var gr = new GlideRecord('incident');
10+
if (gr.get(inc)) {
11+
result.cmdb_ci = gr.cmdb_ci.toString();
12+
result.priority = gr.priority.toString();
13+
result.assignment_group = gr.assignment_group.toString();
14+
result.short_description = gr.short_description.toString();
15+
result.description = gr.description.toString();
16+
}
17+
18+
return JSON.stringify(result);
19+
},
20+
21+
type: 'IncidentDetails'
22+
});

0 commit comments

Comments
 (0)