State changes to Awaiting Acceptance instead of Closed Complete

Andre Jones
Tera Expert

Hello

 

State changes to Awaiting Acceptance instead of Closed Complete when I select the UI Action button Closed Complete. It appears to only affect old cases for some reason.

AndreJones_0-1702590228943.png

the state below.

AndreJones_1-1702590273692.png

 

 

1 ACCEPTED SOLUTION

@Andre Jones You will have to update that field (using code ) so that the open cases that were created prior to setting that value on the HR Service.

 

Regards,

Mike

View solution in original post

9 REPLIES 9

Hello @michaelj_sherid , How would I do this? For historical cases, you will need to update this value based on your use case if it calls to have historical cases skip user acceptance.

Like what would be an example or configuration solution?

@Andre Jones You will have to update that field (using code ) so that the open cases that were created prior to setting that value on the HR Service.

 

Regards,

Mike

Thank you.

var grHRCases = new GlideRecord("sn_hr_core_case");
grHRCases.addEncodedQuery("skip_automatic_user_acceptance_state=false^sys_created_on<javascript&colon;gs.dateGenerate('2023-12-07','00:00:00')")
grHRCases.setLimit(1); // try with one first
grHRCases.query();
while(grHRCases.next()){
    grHRCases.skip_automatic_user_acceptance_state = true;
    // grHRCases.work_notes = 'Add some work notes optional';
    grHRCases.update();
}

Please let me know if this helps, trying to do the same thing for our instance.

 

Thanks,

ya1988bk
Tera Contributor

Alternative solution with less code using GlideQuery

 

new global.GlideQuery("sn_hr_core_case")
 .where("skip_automatic_user_acceptance_state", false)
 .limit(1) // Test on one case first
 .updateMultiple(skip_automatic_user_acceptance_state: true);