Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Servicenow Access Request automation

Manohararuna
Tera Contributor

Hello Everyone,

 

I have one requirement to automate to add the groups the user.

i have catalog item having the variable Required Groups and type is Multiline text and having Model Person variable and it is reference type connected to Sys User table, Model person Related Groups list collector type .

if the client after select the Model Person that person related groups are auto populate in Model person Related Groups variable. the client just copied required groups and paste the Required groups and order the place. 

after the under RITM Approvals will trigger ,after approving the approval Task should create and add groups to the user , if the user already having those group removed those groups and add those groups again after that task should go to closed completed state and RITM as well go to Closed completed state.

 

For this provide me possibilities ways of solution.

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Manohararuna 

this looks like a complete requirement.

what part you started and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Kilo Patron

Hi @Manohararuna 

 

(Draft Solution)

1. Configure Catalog item: configure it as per requirement .

                                                Only recommendation is to make type of required group  as list collector instead of Multiline text  for cleaner mapping for multi select.

 

2. Create a new Flow in Flow Designer triggered by Service Catalog. 

  • Trigger: Service Catalog(sc_cat_item).
  • Get Variable Records: Get the variables from fd_data.trigger.request_item.
  • Approval Action: Add "Ask for Approval" for the manager of the Model Person Variable.
  • Loop Action (For Each):
    • Since the "Required Groups" is a multiline text field, you will need to parse the input to get individual Group Sys IDs.
    • Recommended Alternative: If "Required Groups" is a comma-separated list of IDs or a List Collector, use For Each group in [Required Groups].
  • Look Up Records: Inside the loop, check the group member  table to see if User is Model Person AND Group is Current Item from loop
  • If Loop (If Group Member not found):
    • Create Record: Create a new record in sys_user_grmember table .
  • Create Catalog Task: Create a task assigned to the appropriate group to notify them of the change.
  • Update Record (RITM): Set the RITM state to "Closed Complete"
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Hi Thanushree,

Thanks for the solution but Except that any another way ? why because after giving group to the user , suppose if the user not able to access servicenow then after 45 he lost servicenow Access means roles related groups have been removed but user is part of the group in that case this solution will not work.

 

Thanks,

D Manohar Reddy.