ServiceNow-Beispiel 1
Übernahme von Daten aus einem Problem-Ticket in einen Problem-Task: 1: function onLoad() { 2: try{ 3: if(g_form.isNewRecord()){ 4: var problemID = g_form.getValue('problem'); 5: var problem = new GlideRecord('problem'); 6: problem.get(problemID); 7: 8: g_form.setValue('u_business_service', problem.u_business_service); 9: g_form.setValue('cmdb_ci', problem.cmdb_ci); 10: g_form.setValue('due_date', problem.due_date); 11: g_form.setValue('priority', problem.priority); 12: g_form.setValue('assignment_group', problem.assignment_group); 13: g_form.setValue('short_description', problem.short_description); 14: } 15: } 16: catch(exception) 17: { 18: alert("Error: " + exception); 19: } 20: }