Skip to content

Commit 1b5b6b3

Browse files
authored
Create IncidentToProblemMapping.js
This file includes a client script that maps the values from parent incident record fields to the problem record fields.
1 parent d3cde61 commit 1b5b6b3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//Client script to map the fields in problem
2+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
3+
4+
if (newValue === '') {
5+
return;
6+
}
7+
8+
var ga = new GlideAjax('IncidentDetails');
9+
ga.addParam('sysparm_name', 'getIncidentDetails');
10+
ga.addParam('sysparm_incidentSysId', newValue);
11+
ga.getXMLAnswer(function(response) {
12+
var result = JSON.parse(response);
13+
14+
g_form.setValue('cmdb_ci', result.cmdb_ci);
15+
g_form.setValue('priority', result.priority);
16+
g_form.setValue('assignment_group', result.assignment_group);
17+
g_form.setValue('short_description', result.short_description);
18+
g_form.setValue('description', result.description);
19+
});
20+
21+
}

0 commit comments

Comments
 (0)