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.

Background script : issue with the HR role assignment

mehtaaaksha
Tera Expert

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.

6 REPLIES 6

J Siva
Kilo Patron

Hi @mehtaaaksha 

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

 

JSiva_0-1746936726536.png

Note: If that field is not available in the form view, you can update it from the list view.

 

Regards,
Siva

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.

@mehtaaaksha 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

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.