User wants INC reopened
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:50 AM
User has reported "I have tried keep the ticket (INC123456) in pending when I update the ticket with pending notes but the ticket was showing closed cancel." I believe they want the INC reopening, can anyone tell what background script I have to use, the script needs to be active=true, i will be running that through incident that is closed/cancelled
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:53 AM
It is not a best practice to reopen any closed / cancelled Incident , even will not recommend to do via script.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:01 AM
Hi @Mohammed Asad
I also agreed with @Dr Atul G- LNG sir, its not a best practice to reopen any closed / cancelled Incident , even will not recommend to do via script.
Still i`m providing the background script for the same:
var incidentGR = new GlideRecord('incident');
if (incidentGR.get('7163723a4755c2102ab9d44a516d4362')) { // Replace your_sys_id_here with the actual sys_id
incidentGR.setValue('state', 2); // Assuming 4 is Pending, replace with correct value if different
incidentGR.setValue('active', true); // Reactivate the incident
incidentGR.update();
gs.info('Incident ' + incidentGR.number + ' updated successfully');
} else {
gs.error('Incident not found');
}
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma