- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 02:14 AM
Hi asifnoor,
Similarly we are using setUseEngine scripted REST API. where SetUseEngine is used to avoid Duplicate SLA. Can we do the same for this as well ?
below is our code.
var body = request.body.data;
gs.info("[Add Note To Incident] Processing message: {alias=" + body.alias + ", note=" + body.workNotes + "}");
var alertAlias = body.alias;
var note = body.workNotes;
var inc = new GlideRecord('incident');
inc.addQuery("x_alert_alias", alertAlias);
inc.addQuery('state','!=', 6);
inc.addQuery('state','!=', 7);
inc.addQuery('state','!=', 8);
inc.query();
if (inc.next()) {
inc.work_notes = note;
inc.setUseEngines(false);//Added to stop SLA Duplicate issue
inc.update();
gs.info("[Add Note To Incident] Processing finished.");
} else {
gs.error('[Add Note To Incident] Unable to find incident with x_alert_alias : ' + alertAlias);
}
kindly suggest.
Thanks,
Meenal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 05:22 PM
It makes sense for that API to be disallowed in an application scope.
What is the reason for doing this in an application scope? Perhaps it would be more appropriate in Global?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 07:15 PM
Hi paul,
This is integration between SNOW and Third party that's the reason it is in Scoped Application.
Thanks and Regards,
Meenal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 07:26 PM
Is this bound for the Application Store?
If so, you can't use the Global Script Include workaround mentioned, as that cannot be packaged as part of your application.
Is there scope to get the existing Data Policies converted to UI Policies?
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2020 08:03 PM
Hi Paul,
so in this case according to the comments they're are using setUseEngines(false) to avoid duplicate SLA creation.
Is there any other way to replace this in scope application?
var alertAlias = body.alias;
var note = body.workNotes;
var inc = new GlideRecord('incident');
inc.addQuery("x_alert_alias", alertAlias);
inc.addQuery('state','!=', 6);
inc.addQuery('state','!=', 7);
inc.addQuery('state','!=', 8);
inc.query();
if (inc.next()) {
inc.work_notes = note;
inc.setUseEngines(false);//Added to stop SLA Duplicate issue
inc.update();
gs.info("[Add Note To Incident] Processing finished.");
} else {
gs.error('[Add Note To Incident] Unable to find incident with x_alert_alias : ' + alertAlias);
}
Kindly suggest!
Thanks for the response.
Meenal