Creating Standard Change using sn_chg_rest REST API scope
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 09:46 PM
Using the REST API api/sn_chg_rest/change/standard I am getting the following error.
If I call the script using user account with ITIL role its OK.
Without using the ITIL role what permissions to which tables do I need to define? I have so far given read,write,create permissions to a user defined role to tables - change_request, std_change_record_producer, std_change_template and std_change_producer_version
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 10:14 PM
I'm sorry. I'm a beginner, too

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 11:17 PM
Hi chito,
According to me this is happening because message and details does not contain any value so that it is not getting converted to JSON data.
Please mark if that helps to you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 11:29 PM
Not really. As I mentioned, if I make the call using a user with ITIL role it is completing successfully.
Here's the snippet of the script include that mentioned in the error:
//
var StandardChangeTemplateSNC = Class.create();
StandardChangeTemplateSNC.CHANGE_RECORD_PRODUCER = "std_change_record_producer";
StandardChangeTemplateSNC.CHANGE_TEMPLATE = "std_change_template";
StandardChangeTemplateSNC.prototype = Object.extendsObject(ChangeProcess, {
initialize: function(_gr, _gs) {
ChangeProcess.prototype.initialize.call(this, _gr, _gs);
},
applyToChange: function(changeRequestGr) {
if (!changeRequestGr)
return false;
changeRequestGr.std_change_producer_version = this.getGlideRecord().current_version + "";
if (GlideDBObjectManager.getTables(this.getGlideRecord().getTableName()).contains(StandardChangeTemplateSNC.CHANGE_RECORD_PRODUCER))
return new GlideTemplate.getFromRecord(this.getGlideRecord().template.getRefRecord()).apply(changeRequestGr) === 0 ? true : false;
return false;
},
type: "StandardChangeTemplateSNC"
});
StandardChangeTemplateSNC.findById = function(sysId) {
if (!sysId)
return null;
var changeRecordProducerGr = new GlideRecordSecure(StandardChangeTemplateSNC.CHANGE_RECORD_PRODUCER);
if (!changeRecordProducerGr.get(sysId))
return null;
return new StandardChangeTemplate(changeRecordProducerGr);
};
StandardChangeTemplateSNC.findAll = function(orderBy, textSearch) {
orderBy = orderBy || ChangeProcess.NAME;
var changeRecordProducerGr = new GlideRecordSecure(StandardChangeTemplateSNC.CHANGE_RECORD_PRODUCER);
changeRecordProducerGr.addActiveQuery();
changeRecordProducerGr.addQuery("retired", false);
if (textSearch !== undefined && textSearch !== "undefined" && textSearch.trim() !== "")
changeRecordProducerGr.addQuery("template.name", "CONTAINS", textSearch).addOrCondition("template.short_description", "CONTAINS", textSearch);
changeRecordProducerGr.orderBy(orderBy);
changeRecordProducerGr.query();
return changeRecordProducerGr;
};
//

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 11:36 PM
if you will allow non itil users to create change request, it will again take huge changes on existing ACL configuration,