Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Auto assignment of sn_cmdb_user for CMDB Workspace

Joseph Lighthal
Tera Contributor

How should I be managing the assignment of the role sn_cmdb_user? I would think this role should be automatically assigned in the situation a cmdb_data_management_task is assigned to a specific individual but that is not the case. I'm curious should I make a business rule to automatically assign the role? What do you recommend?

1 ACCEPTED SOLUTION

Hi Joesph,

 

Thanks for the question and feedback.  Auto-assignment of a role to a user assigned a task is being reviewed as a future enhancement to Data Manager for Data Certification. 

The one difference in relation to your original question is that the data_manager_user role would be used.  The reason for this is that access to the Tasks section in the forthcoming Service Graph Workspace will use this role so users do not necessarily need to be granted access to the CMDB.  In this scenario, a user with the data_manager_user role is able to open Service Graph Workspace and access Tasks only.

View solution in original post

7 REPLIES 7

Ajay_Chavan
Kilo Sage

@Joseph Lighthal 

 

Although it is technically possible, adding the role to the user based on the task assignment (cmdb_data_management_task) by writing BR would not be a good idea.

 

there are two simple ways you achieve this

 

Group-Based Assignment:

The most common method is to automatically assign a role to a user when they become a member of a specific group. 
- Process: Go to User Administration > Users, open a user record, and add them to a group. The role associated with that group will be assigned to the user.

 

Flow Designer & Catalog Items:

For more dynamic role assignment based on user input, you can use a catalog item and a flow to trigger the process. 
Process:
 
-Create a catalog item for users to request roles. 
-Create a Flow Designer flow that triggers from the catalog item submission. 
-Within the flow, add an action to select the user and the desired role(s). 
-The flow then creates the necessary records in the sys_user_has_role table to map the role to the user. Alternatively, you can add a user to a group that already has the role, and the user will automatically gain the role by adding it to the group.



 

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****

@Joseph Lighthal  - did you get a chance to check?

 

 

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****

Bhuvan
Giga Patron

@Joseph Lighthal 

 

I would recommend to check when a task is assigned to the user, if the user has sn_cmdb_user role and if they do not have necessary role, display an error message and suggest to select an user with role. If needed, create a task or request for role assignment to the requested user so that it can be acted upon and access is provided.

 

There are possibilities a user might be assigned by mistake or if unintended user is selected, you would not have gate checks before providing role if you do automatic role assignment. 

 

If you do not want approver for CMDB data management task, you can use below knowledge article

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1362321

 

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan

kaushal_snow
Giga Sage

Hi @Joseph Lighthal ,

 

Here are a couple of ways to handle this:

 

  • Business Rule: Create a Business Rule on cmdb_data_management_task (post insert) that automatically adds the sn_cmdb_user role to the assigned user....
  • Group Based Role: Assign the role to a group, and make sure task assignments align with that group. You can also automate role granting/removal via Flow or Scheduled Job for precise control....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Technical Consultant/Developer