Access to api 'setWorkflow' from a custom scope

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2018 05:48 PM
I have a simple task but feel like I'm hitting a wall. I need to call setWorkflow on a basic table (e.g. 'task' table) from a scoped application:
var gr = new GlideRecord("task");
gr.setWorkflow(false);
I know that cross-scope privileges required, so I created multiple (I'm just desperate to get it work):
And it still doesn't work. When I run those 2 lines of code in a script-background in a context of my scoped app, I get a message:
Security restricted: Access to api 'setWorkflow' from scope '----' has been refused due to the api's cross-scope access policy
Is that something missing in cross-scope privileges?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 02:09 AM
Hey ,
Did you try checking your app's access in "sys_scope_privilege" table.
You can read about the working of it here
Please Mark Helpful / Correct answer accordingly if it is.
Thanks,
Prasanna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 04:25 AM
HI hchulin
Please check the below link it may help you
https://community.servicenow.com/community?id=community_question&sys_id=db10d3e5dbdcdbc01dcaf3231f9619b6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 06:30 AM
I have to say that most likely it's just not possible to call setWorkflow on out-of-the-scope tables. Within the scope, it works just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2022 03:56 AM
I ran into the similar issue. I have created cross scope access for setWorkflow, from my own scope to Global:
- I can call setWorkflow from my own scope, on my own scope tables
- I cannot call setWorkflow from my own scope, on tables in different scopes