Help with System properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Team,
I have a system properties in Custom scope A. And there is scripted rest API in Custom scope B. I am trying to update the system property but, unable to update it.
Error
1.
2. Write operation against 'sys_properties' from scope 'custom_scope_name' has been refused due to the table's cross-scope access policy
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@Abhijit Das7 please create/update/verify the entry in "sys_scope_privilege" table as follow:
- Click New to create a new cross-scope access rule.
- Fill in the following details:
- Calling Application: Select the application for Custom Scope B.
- Target Table:
sys_properties. - Operation:
update(orwriteif you want to allow all write operations). - Active: Check this box to activate the rule.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
that's blocked due to cross scope.
Why not create that property in same scope as that of Scripted REST API?
what's the purpose behind creating that property in other scope?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hello @Abhijit Das7 ,
You can’t directly update sys_properties across scopes. The cleanest solution is to wrap the update logic in a Script Include in the property’s scope, mark it accessible, and call it from your REST API. That keeps you compliant with ServiceNow’s cross-scope security model.
Script Include :
Script :
updateProperty: function(name, value) {
var prop = new GlideRecord('sys_properties');
if (prop.get('name', name)) {
prop.value = value;
prop.update();
}
}
Then call this SC from another scope :
var propertyName = <Name>;
var newValue = <value>;
new PropertyUtil().updateProperty(propertyName, newValue);
gs.info(gs.getProperty(propertyName));
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
34m ago
Hi @yashkamde,
As per ServiceNow we shifted our Scripted REST API code to Script Include. And we call script include inside the Scripted REST API.
So, now you want me to create a new script include in same scope in which system property is present. And call this script include inside the main script include of Scripted REST API which is present in another scope.
Can you please elighten me on this?
