Replicate group along with same sys_id in my all instances
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2018 12:21 AM
I have a requirement. Whenever a group is created in one of my servicenow instance, the group should auto replicate to other instances. My problem is to maintain sys_id of group in all instances if I use REST API to transfer group info. How can I achive it. Any help is highly appreciated.
Thanks,
Smruti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2018 03:23 AM
I want to complete this process automatically without manually export/import. I want to schedule it.
Thanks,
Smruti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2018 11:50 AM
Using REST I may able to transfer group detail after creation from one instance to another. But I want to set sae sys_id during this integration. Kindly suggest.
Thanks,
Smruti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2019 10:15 PM
I was just looking at something in this area right now...
you can have an on insert BR and in the script use the following
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://xxxxxxxtest.service-now.com/api/now/table/sys_user_group');
request.setHttpMethod('POST');
//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';
request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");
var body = {"name":current.name,"sys_id":current.sys_id};
var bodyString = JSON.stringify(body);
request.setRequestBody(bodyString);
var response = request.execute();
gs.log(response.getBody());