I have to close many hr case.

niveditakumari
Mega Sage

Hi, 

 

I have to close many hr case without sending notifications to users. 

There are many hr case with different hr service.

How I can achieve that. 

 

Regards, 

Nivedita

 

 

2 ACCEPTED SOLUTIONS

Hello @niveditakumari 

var gr = new GlideRecord('sn_hr_core_case');
gr.addEncodedQuery('numberINHRC011111,HRC012344'); 
gr.query(); 
while(gr.next()) { 
gr.setWorkflow(false); 
gr.state = 'Closed Completed'; 
gr.update();
} 

View solution in original post

 

I have correct that and it is working. 

 

var c = 0;
var gr = new GlideRecord('sn_hr_core_case');
gr.addEncodedQuery('numberINHRC01111,HRC01112,HRC01113,HRC01114');
gr.query();
while(gr.next()) {
c++;
gr.setWorkflow(false);
gr.state = '3';
gr.update();
gs.info('HR case closed successful'+c);

 

 

View solution in original post

8 REPLIES 8

Please add gr.update() just after line gr.state

 

I have correct that and it is working. 

 

var c = 0;
var gr = new GlideRecord('sn_hr_core_case');
gr.addEncodedQuery('numberINHRC01111,HRC01112,HRC01113,HRC01114');
gr.query();
while(gr.next()) {
c++;
gr.setWorkflow(false);
gr.state = '3';
gr.update();
gs.info('HR case closed successful'+c);

 

 

Hello @niveditakumari 


Please mark my answer as solution proposed and helpful as well.

 

Thanks,

Harsh

Hello @niveditakumari 

var gr = new GlideRecord('sn_hr_core_case');
gr.addEncodedQuery('numberINHRC011111,HRC012344'); 
gr.query(); 
while(gr.next()) { 
gr.setWorkflow(false); 
gr.state = 'Closed Completed'; 
gr.update();
}