- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-10-2022 10:27 AM
Hi experts,
We got a request from one of our clients to resolve all the tickets which are in state new with specific close codes and notes,also with work notes? also want to update some fields on incident form
Before resolving he wants to assign all those tickets to one ITIL user
I have been trying to create one fix script for that but I am not sure whether it will help me or not
Is there any way I can fulfill this type of requirement?
Fields need to be updated :
Item -
Incident State - New
Impact and urgency - 3 medium
Assigned to -
Close code - permanant
Close Notes -
Work notes-
Additional comment-
Any kind of help is greatly appreciated!
Thank you
Ujjwala
Solved! Go to Solution.
- Labels:
-
Cost Management (ITSM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-10-2022 06:53 PM
Hi,
you can try the below script for bulk closure.
bulkClosure();
function bulkClosure(){
var inc = new GlideRecord('incident');
inc.addEncodedQuery('add-your-query-here');
inc.query();
while(inc.next()){
inc.incident_state = '6'; // resolved
inc.active = 'false';
inc.cmdb_ci= 'add ci name here';
inc.impact = '3';
inc.urgency = '3';
inc.assigned_to ='sys_id-of -assigned-users';
inc.close_code = 'permanant';
inc.close_notes ='closed notes';
inc.work_note = "add work notes here";
inc.comments = 'add additional comments here';
inc.setWorkflow('false');
inc.autoSysFields('false');
inc.update();
}
gs.info("resolved: " + inc.getRowCount());
}
Regards,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-10-2022 06:53 PM
Hi,
you can try the below script for bulk closure.
bulkClosure();
function bulkClosure(){
var inc = new GlideRecord('incident');
inc.addEncodedQuery('add-your-query-here');
inc.query();
while(inc.next()){
inc.incident_state = '6'; // resolved
inc.active = 'false';
inc.cmdb_ci= 'add ci name here';
inc.impact = '3';
inc.urgency = '3';
inc.assigned_to ='sys_id-of -assigned-users';
inc.close_code = 'permanant';
inc.close_notes ='closed notes';
inc.work_note = "add work notes here";
inc.comments = 'add additional comments here';
inc.setWorkflow('false');
inc.autoSysFields('false');
inc.update();
}
gs.info("resolved: " + inc.getRowCount());
}
Regards,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-11-2022 02:46 AM
Hi
The script worked out for me, Thank you very much!