Automated script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 02:29 PM
is there any scripts which can be used to run after patches.
Scripts to create/close new incident, change and problem ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 02:52 PM
HI Eashwar,
Can you please elaborate your question further.
If you want to mass update the bulk records then you can prepare a fix script and run it through Background script or as part of fix script.
Please let me know if you have any questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 03:06 PM
Hi Pradeep,
Basically I wanted to write some test scripts which can,
1. Create and Close test incident/Problem/Change
Instead of manually creating one.
This way I can run it to test ITIL functionality after patching.
Thank you,
Eashwar Elumalai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-04-2016 03:17 PM
Yes, you obviously can very easily script something that will do this. Are you just asking us to do it for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2015 10:36 PM
Hi Eashwar,
You could use javascript to create update and delete records and run these via Background Scripts:
along the lines of:
Using GlideRecord to Query Tables - ServiceNow Wiki
..
3.2 update
var rec = new GlideRecord('incident');
rec.addQuery('active',true);
rec.query();
while (rec.next()) {
rec.active = false;
gs.print('Active incident ' + rec.number = ' closed');
rec.update();
}
3.3 insert
var rec = new GlideRecord('incident');
rec.initialize();
rec.short_description = 'Network problem';
rec.caller_id.setDisplayValue('Joe Employee');
rec.insert();
3.4 delete
var rec = new GlideRecord('incident');
rec.addQuery('active',false);
rec.query();
while (rec.next()) {
gs.print('Inactive incident ' + rec.number + ' deleted');
rec.deleteRecord();
}
Or you could consider automated testing via the GUI.
There are quite a lot of free tools available to test web applications.
Perhaps some Community members have done something similar, and might share their experiences.
Best Regards
Tony