Rafael Batistot
Kilo Patron

Hi @Swathi504893573 This might help you 

 

https://www.servicenow.com/community/developer-forum/need-help-to-close-bulk-ritms-and-sc-tasks-effi...

See an example of code to get all them: 

 

var gr = new GlideRecord('sc_req_item');
gr.addQuery('cat_item','YOUR_CATALOG_ITEM_SYS_ID');
gr.addQuery('state','!=',3);
gr.query();
while (gr.next()) {
gr.state = 3;
gr.stage = 'completed';
gr.update();
}

 

If this response was helpful, please mark it as Helpful and, if applicable, as Correct, this helps other users find accurate and useful information more easily.