Solution: Import Group Along With Members, Roles Through XML

In below article we have given step to step representation along with video demonstration that how you can import user, roles and group in servicenow instance or in other words if we say then how you can import group which have group members and roles assigned.

Import user, role and group in ServiceNow

In ServiceNow if we talk about group, user and roles then we know that or we should be aware of below things:
  • When we create a role in servicenow, then it captures in local update set.
  • But when we create user in servicenow, then it will not capture in update set.
  • And when we create group in servicenow then it is also not captured in update set.
So, the problem occurs, when we move group from one instance to another instance because we know that group and its data will not get captured in update set, so we move it manually through XML, CSV etc. While moving the data from once instance to another we should be aware of that from where we export the data and in which sequence, we need to do that.

For example, let’s say, if we move group along with roles and the members assigned to that group to production instance from the developer instance.

There are lots of ways to do that, you can do it from import xml, CSV or excel etc. So here we are suggesting only one way that is through XML. Where we import XML from one instance and export XML to another instance. There are few things which we need to take care while doing this transaction. We will also cover those at the bottom of this page.

So, Now let’s focus on 

how to import groups along with members and roles through XML in ServiceNow:

So, let’s say we have ServiceNow developer instance where we have a group along with members and roles and now, we want to move this to ServiceNow Production instance.

** Please make sure to do all activities mentioned below, you should have admin roles.

So, first activity which are going to do is exporting the data into XML from one instance that is ServiceNow Developer Instance:

  • So first open ServiceNow developer instance. 
  • Navigate "User administration -> Groups (sys_user_group.list)" and open the group which you want to move to another instance.
  • Click on let top corner Additional actions (four vertical line image) and then export it into XML. (This activity is basically for Group Only). You can rename the file if you want so that while importing you can relate it.
  • Now for group members, in application navigator type (sys_user_grmember.list) and press enter.
  • Now filter the results by entering your group name which you want to move.
  • Now click on their vertical line displayed along with Name label and export the list into XML and download the same. (this activity is basically for Group members)
  • Now we need to import the roles assigned to group right. so for that type "sys_group_has_role.list" in application navigator.
  • Now filter the results by entering your group name which you want to move.
  • Now click on their vertical line displayed along with Name label and export the list into XML and download the same.

Now the second activity which we are going to do is, importing the data into target instance that is ServiceNow production instance:

  • So first open Target instance or ServiceNow Production instance.
  • Navigate "User administration -> Groups"
  • Now click on their vertical line displayed along with Name label and click on Import XML.
  • Browse the file you have exported for group and click on upload button. You will find group gets uploaded into the instance but without role and group members details. (Manager name will get populated in manager field only if Manager is available in the targeted instance) 
  • Now for group members, in application navigator type (sys_user_grmember.list) and press enter.
  • Now click on their vertical line displayed along with group label and click on importXML.
  • Browse the XML file you have exported earlier for group members. You will find the entries in the same list view.
  • Now for roles assigned to that group, in application navigator type ( sys_group_has_role.list) and press enter.
  • Now click on their vertical line displayed along with group label and click on importXML.
  • Browse the XML file you have exported earlier for group roles. You will find the entries in the same list view.
Now you can open the group and validate the data. Group along with group members and given roles will get populated in targeted instance i.e. in ServiceNow production instance.

As we have mentioned above while doing all above transaction, you should take care of below things:

  • You should check that what all user of the groups are available in the targeted instance. Otherwise after importing the data in targeted instance those users will be displayed as empty. So to populate those users you have to export those users XML  from user table and import the same in targeted instance user table. After doing this empty field automatically replace with username because that empty record contains same user sys_id. 
  • Same as above for roles. Roles should also be validated otherwise same activity has to be done for roles as well.
  • Make sure that first import the group XML and then import members XML or roles XML in targeted instance.
For the understanding of this topic we have posted a video on our you tube channel. Please find the link below which will help you to understand this in details and in practical way.


We believe above information will help you understand the required topic i.e How to move or import group, user and role in ServiceNow instance. Please feel free to provide you suggestions and feedback in below comment box. Your comment provide us motivation to post more ServiceNow study materials and ServiceNow Development Training videos. Thankyou!!! Happy Learning, Basico ServiceNow Learning.

4 comments:

  1. thank u sir for your information!

    ReplyDelete
  2. Thanks for the clear explanation. Very helpful to a newb!

    ReplyDelete
  3. where can we find the catalog item requirement (excel sheet)

    ReplyDelete

Thankyou !!!!

Powered by Blogger.