Implement Integration Error Alerts(I need to be notified when the Mainframe Import fails)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Please provide me with development steps and transform script for below story:
Thank you in advance!!
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @chetanasand ,
It can be done in several ways.
Option 1: Create an onComplete script on your transform map.
Active: true
Type: onComplete
Sample Script (not tested):
var importSetRun = new GlideRecord('sys_import_set_run'); if (importSetRun.get(import_set.sys_id)) { if (importSetRun.state == 'complete_with_errors' || importSetRun.state == 'error') { var grINC = new GlideRecord('incident'); grINC.initialize();
grINC.short_description = '[service (mainframe / control M)] ->' + import_set.name + '[Error]';
grINC.description = '[service (mainframe / control M)] ->' + import_set.sys_id + ' failed. Check details: ' + gs.getProperty('glide.servlet.uri') + current.getLink();
grINC.business_service = <sys_id of Servicenow> ; //Update it
grINC.business_impact = <Delayed batch job fixes>;
grINC.assignment_group = <sys_id of ITSM Tools - ServiceNow Platform Support teams group>;
grINC.caller = <sys_id of service account by which all jobs run in your instance> ; grINC.insert(); } }
Option 2: By Creating a Update Business Rule
Table : Transform History table [sys_import_set_run]
When to run : state changes to 'Complete with Errors'.
Update : true
Insert : false.
Sample Script (Not tested):
var grINC = new GlideRecord('incident');
grINC.initialize(); //Incident Details you update as per your requirement
grINC.short_description = '[service (mainframe / control M)] ->' + current.name + '[Error]';
grInc.description = '[service (mainframe / control M)] ->' + current.sys_id + ' failed. Check details: ' + gs.getProperty('glide.servlet.uri') + current.getLink();
grINC.business_service = <sys_id of Servicenow> ; //Update it
grINC.business_impact = <Delayed batch job fixes>;
grINC.assignment_group = <sys_id of ITSM Tools - ServiceNow Platform Support teams group>;
grINC.caller = <sys_id of service account by which all jobs run in your instance> ;
grINC.insert();
}
3. Using Flow also you can achieve the same.
