HR Profiles Getting created automatically

Uzzawal Agrawa1
Giga Contributor

Hello Experts, 

I am facing a weird issue in a customer instance.  

When an end user (without HR Profile record) is logging in ServiceNow and trying to access the "hrportal" url, system is creating a HR profile for the same user automatically. 

This is not happening in my OOB personal dev. 

Any inputs or comments please ?

Regards,

1 ACCEPTED SOLUTION

marcloding
Kilo Expert

Hi,

 

We had a similar issue. Where HR profiles were being created when a user logged into the Portal. We had to do the following:

Comment out lines of code in the Portal Tables: Header | Footer, We use the 'HRI Header'. (we commented out lines 23-29):

       // HR Profile
       // var gr = new GlideRecord('sn_hr_core_profile');
       // gr.addQuery('user', gs.getUserID());
       // gr.query();
       // if (!gr.next()) {
       // gr.setValue('user', gs.getUserID());
       // gr.insert();
       // }

Please be aware that we create the HR Profile for all supported users when the sys_user record is created and we have SSO setup.

Hope this helps. Also check to make sure that duplicate HR Profiles are not being created when a HR Case is being submitted as well. We had an issue where the support agent did not having access to the user's HR Profile, So it would create a duplicate HR Profile when a ticket was submitted. We had to modify some ACLs for this to work.

Thanks

 

View solution in original post

12 REPLIES 12

For the later versions of ESC, you will see this code in the ESC Header widget. You can comment out the same code in that widget accordingly.

Regards,

Mike

muzhda
Tera Expert

From my understanding - if a user doesn't have an HR Porfile, but they have been provisioned the employee roles required to access the HR Portal on there first attempt to access the HR Portal the system creates an HR Profile for them (this is the behavior in our instance as well).

Also, HR Profiles got automatically created for users when someone creates a HR Case for them for the first time.

Can I ask - what is the issue with the HR profile being generated - I'm curious to know if this is something we should also be concerned about.

Loding_m
Tera Contributor

Hi Muzhda,

The issue that I was originally facing in our instance. Was that a customer (from the Service Portal) or a support agent (from the Service Catalog) would create a ticket for a particular user. That user had a sys_user record and a Hr Profile record. However, that customer/support agent didnt have access to the HR Profile record. So when the workflow did a check for the HR Profile, it would not find one. At that point it would generate a new HR Profile (a duplicate with all the same information from the original) and then create a ticket. 

Please let me know if you need more information.

Thanks!