Business rule application scope changed when it's create by rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2024 01:09 AM - edited 01-31-2024 02:08 AM
I creating business rule by rest api with application scope global,
but it's saved with different scope "Incident Management for Service Operations Workspace" instead.
This my request body you can see include sys_scop global:
URL: POST https://{{instance}}.service-now.com/api/now/table/sys_script
{
"client_callable": "false",
"access": "package_private",
"action_insert": "true",
"action_update": "true",
"advanced": "true",
"action_delete": "false",
"change_fields": "false",
"action_query": "false",
"when": "after",
"sys_class_name": "sys_script",
"is_rest": "false",
"sys_scope": {
"link": "https://{instance}.service-now.com/api/now/v1/table/sys_scope/global",
"value": "global"
},
"sys_updated_by": "admin",
"rest_service_text": "",
"sys_name": "test task events",
"add_message": "false",
"active": "true",
"collection": "task",
"script": "(function executeRule(current, previous \/*null when async*\/) {\r\n\r\nif (current.operation() === 'insert')\r\n gs.eventQueue(\"task.inserted\", current, gs.getUserID(), gs.getUserName());\r\nif (current.operation() === 'update')\r\n gs.eventQueue(\"task.updated\", current, gs.getUserID(), gs.getUserName());\r\n\r\n})(current, previous);",
"abort_action": "false",
"execute_function": "false",
"name": "test task events",
}
In the response the sys_scope changed to
How i can save BR with global scope?