- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2020 05:47 AM
Hi,
Can we change the scope of the record producer? We have initially created Record producers on Incident and some Catalog items. Now we want all of them to be Changed to be Record producers on Case table. We were able to change the table name from incident to Case. But unable to change the application scope.
We tried Background script, tried to create data policy, client script to make Application field (sys_scope) editable. But none worked. My background script is removing previous scope Global from field but not updating it to Customer service scope. Below is the script.
var gr_Scope = new GlideRecord("sys_scope");
gr_Scope.addQuery("scope","sn_customerservice");
gr_Scope.query();
if(gr_Scope.next()){
gs.log(gr_Scope.sys_id);}
var gr_rp= new GlideRecord("sc_cat_item_producer");
gr_rp.addQuery('sys_id',"66c313e7c0a8016b008ebe1a8e3d97f5");
gr_rp.query();
if(gr_rp.next()){
gr_rp.sys_scope = gr_Scope.sys_id;
gr_rp.update();
gs.log(gr_rp.getValue("sys_scope"));
}
Any thoughts to solve issue or help is much appreciated.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2020 10:27 PM
Hi Brad, Sumanth,
Thankyou for your response. We were able to change the scoep for one item, then make it as template and re-create other items.
What we did was first to deactivate the ACL's on scope field. Then use a business rule to change the scope of Record producer, and the variables associated with it. Background script did not work.
Hope this helps others trying to change the scope for large no. of items.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2020 05:58 AM
I think your best bet is to recreate them in the new scope. If you have a large number of RPs and variables you could write a script that copies them into a new scope. I've heard of people doing that before but wasn't able to find any examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2020 06:48 AM
Hi ,
Please refer below link:
Please mark it as helpful (or) correct if it helps.
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2020 10:27 PM
Hi Brad, Sumanth,
Thankyou for your response. We were able to change the scoep for one item, then make it as template and re-create other items.
What we did was first to deactivate the ACL's on scope field. Then use a business rule to change the scope of Record producer, and the variables associated with it. Background script did not work.
Hope this helps others trying to change the scope for large no. of items.