Is there a way to provide admin & security_admin role to the users using rest integration.

Prithvi Ramesh1
Mega Sage

Use Case:

Whenever a user requests access from PROD to DEV for admin or security admin roles, the flow should automatically assign the requested roles to the user.
The setup is already in place and works correctly for other roles.


Issue:

  • For the admin role, the flow creates an empty record — the user and group Fields are not populated.
  • For the security admin role, the flow throws the following error:

Error: Operation Failed
Details: Error during insert of sys_user_grmember (test user)
(Process Automation.19602fa1890b261025214ad7e9572531; line 😎

10 REPLIES 10

Ah ok and does your integration user have the security admin assigned to them?

 

As security admin role must be assigned by another security admin, can you please verify this?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Yeah, the integration user is already assigned to the role.

@Prithvi Ramesh1 

are you adding the user to some group?

the error tells it fails for sys_user_grmember and doesn't talk about role

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Some ideas:

  • try assigning the role manually
    • does it work without error?
  • is the sys ID same for PROD and the other (TEST)?

Please @Prithvi Ramesh1 can you share some of your script or configurations? We see only the error as outcome but not what is happening before it..


———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Here are the configuration screenshots for your reference:

 

We are passing the user and group sysIds as an input

 

PrithviRamesh1_0-1754056454949.png

 

Rest Step -

 

PrithviRamesh1_1-1754056504018.pngPrithviRamesh1_2-1754056516944.png

 

Script Step - 

PrithviRamesh1_3-1754056541088.png

Script -

PrithviRamesh1_4-1754056560325.png

Output Variable -

PrithviRamesh1_5-1754056585982.pngPrithviRamesh1_6-1754056597928.png

Error -

PrithviRamesh1_7-1754056635404.pngPrithviRamesh1_8-1754056648365.pngPrithviRamesh1_9-1754056674299.pngPrithviRamesh1_10-1754056695306.pngPrithviRamesh1_11-1754056712279.png