Background script : issue with the HR role assignment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2025 09:08 AM - edited ‎05-11-2025 09:56 PM
Hello Experts,
Post cloning i am trying to assign roles to the parent group through post clone script which will trigger the schedule job but i am facing the below issue.
Schedule Job (Tried execution in Background Script):
Errors :
RoleAccessHandler: User abc does not have the role 'sn_esign.config_manager' which is required to grant/remove 'sn_esign.config_manager' under application administration, Resource: 'record/sys_group_has_role/create'
*** Script: Post Clone Activities completed.
Please help or suggest any approach which i can try.
Thanks.
- Labels:
-
Tokyo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2025 09:14 PM
Hi @Abc 26
In your scheduled job, update the 'Run as' field to the user with the 'sn_hr_core.admin' role.
Support artice: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1639256
Note: If that field is not available in the form view, you can update it from the list view.
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2025 04:27 AM - edited ‎05-11-2025 05:04 AM
Hi @J Siva and @Ankur Bawiskar ,
Thanks for the response.
I have tried assigning the role through the scheduled job which i am executing as a "HR Admin"(OOB profile for HR) but still it is not assigning the role to the parent group as "sn_hr_core.admin".
And the scheduled job will be triggered by the post clone scripts automatically.
Note : It needs to be executed post clone automatically to assign roles to group in HR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2025 05:22 AM - edited ‎05-11-2025 05:22 AM
@Abc 26 is that profile (HR Admin) has admin or user_admin role?
I believe that, the user must have user_admin role to manage group memberships.
So, just assign admin role to the HR Admin user and see
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2025 07:25 AM
Hi @J Siva ,
It is OOB profile and it does not have admin or user_admin role but has the hr admin role.
The above script needs to executed post clone.
Is there a way to elevate a role in scheduled job script.