Error occurs when I save the incident - Invalid update - Match not found, reset to original

littlelingling0
Tera Contributor

I setup some client script to auto fill in the information, when I save the incident, the following error occurs. If I click 'Save' again, it can be save normally.

 

1 ACCEPTED SOLUTION

You need to pass in sys id of group instead of name. try something like below

g_form.setValue('u_owner_group', 'xxxx sysid of group xxxxxxxxxx'); 

View solution in original post

7 REPLIES 7

Mike Patel
Tera Sage
Can you share client script?

Here is the script.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

//Type appropriate comment here, and begin script below
var gr=new GlideRecord("sys_user");
gr.addQuery("sys_id", newValue);
gr.query();

var temp;
if(gr.next()){

if(gr.u_owner_group == '43815a1ddbf0170033c79c18db96191d'){
g_form.setValue('u_owner_group', "RSD - HK");
}
else if(gr.u_owner_group == 'c08a93aa6fd71100b4046592be3ee46e'){
g_form.setValue('u_owner_group', "Service Desk HK"); //Service Desk HK
}
else if(gr.u_owner_group == '129adf6a6fd71100b4046592be3ee48c'){
g_form.setValue('u_owner_group', ""); //Service Desk China
}
else if(gr.u_owner_group == 'c9d9c40c6f31210085ecf13f5d3ee4dd'){
g_form.setValue('u_owner_group', ""); //Taiwan OA Helpdesk
}
else if(gr.u_owner_group == '3834a6d66f3af10085ecf13f5d3ee4e8'){
g_form.setValue('u_owner_group', ""); //Service Desk AU
}
else if(gr.u_owner_group == '5c545caf0f651200a72ab57ce1050e1c'){
g_form.setValue('u_owner_group', "Service Desk TH"); //Service Desk TH
}
else if(gr.u_owner_group == 'b894d8ef0f651200a72ab57ce1050e45'){
g_form.setValue('u_owner_group', ""); //Service Desk MY
}
else if(gr.u_owner_group == 'c50205b40f594200a72ab57ce1050ea4'){
g_form.setValue('u_owner_group', ""); //Service Desk SG
}
else if(gr.u_owner_group == '15a500410f8e5600a72ab57ce1050eae'){
g_form.setValue('u_owner_group', ""); //Service Desk KR
}
else{
g_form.setValue('u_owner_group', "");
}
}
}

Thanks.

Sorry, Here is the correct one.

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}

//Type appropriate comment here, and begin script below
var gr=new GlideRecord("sys_user");
gr.addQuery("sys_id", newValue);
gr.query();

if(gr.next()){
if(gr.u_owner_group == '43815a1ddbf0170033c79c18db96191d'){
g_form.setValue('u_owner_group', "RSD - HK");
}
else if(gr.u_owner_group == 'c08a93aa6fd71100b4046592be3ee46e'){
g_form.setValue('u_owner_group', "Service Desk HK"); //Service Desk HK
}
else if(gr.u_owner_group == '129adf6a6fd71100b4046592be3ee48c'){
g_form.setValue('u_owner_group', "Service Desk China"); //Service Desk China
}
else if(gr.u_owner_group == 'c9d9c40c6f31210085ecf13f5d3ee4dd'){
g_form.setValue('u_owner_group', "Taiwan OA Helpdesk"); //Taiwan OA Helpdesk
}
else if(gr.u_owner_group == '3834a6d66f3af10085ecf13f5d3ee4e8'){
g_form.setValue('u_owner_group', "Service Desk AU"); //Service Desk AU
}
else if(gr.u_owner_group == '5c545caf0f651200a72ab57ce1050e1c'){
g_form.setValue('u_owner_group', "Service Desk TH"); //Service Desk TH
}
else if(gr.u_owner_group == 'b894d8ef0f651200a72ab57ce1050e45'){
g_form.setValue('u_owner_group', "Service Desk MY"); //Service Desk MY
}
else if(gr.u_owner_group == 'c50205b40f594200a72ab57ce1050ea4'){
g_form.setValue('u_owner_group', "Service Desk SG"); //Service Desk SG
}
else if(gr.u_owner_group == '15a500410f8e5600a72ab57ce1050eae'){
g_form.setValue('u_owner_group', "Service Desk KR"); //Service Desk KR
}
else{
g_form.setValue('u_owner_group', "");
}
}
}

 

Thanks. 

You need to pass in sys id of group instead of name. try something like below

g_form.setValue('u_owner_group', 'xxxx sysid of group xxxxxxxxxx');