Can scope of record producer be changed?

Ramya t
Mega Contributor

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.

 

 

 

 

1 ACCEPTED SOLUTION

Ramya t
Mega Contributor

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. 

 

View solution in original post

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

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.

Sumanth16
Kilo Patron

Hi ,

 

Please refer below link:

https://community.servicenow.com/community?id=community_question&sys_id=9b358f6ddbd8dbc01dcaf3231f96...

 

 

Please mark it as helpful (or) correct if it helps.

 

Thanks,

Sumanth

Ramya t
Mega Contributor

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.