Business rule application scope changed when it's create by rest api

gilbs92
Tera Contributor

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 
"sys_scope": {
"value": "49aff4bb733320103e366238edf6a70f"
},
 
I create it by OAuth client application with global scope.
What its the reason the sys_scope changed? 
How i can save BR with global scope?

 

0 REPLIES 0