Provision Department ID to Department on sys_user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 05:08 AM
I am trying to provision users with a custom field.
In our Azure AD / Entra ID, this is called hdsDepartmentNumber
We want this ID to uniquely identify our different departments, in order for our deparments to have the same names, but being unique entities.
The problem is of course that if you were to send a name which matches multiple records, ServiceNow will always chose the first option (?).
Thus, creating unique ID's for each department, and proisioning them would allocate each user to the correct department-entity.
The unique ID's could be for example: 0125.100 which is a record with name = Management
This, we thought would work, using the referenced object attribute. Mapping the value to department.id - which matches 0125.100 and no longer matches department to the department Name.
I understand the issue is that the department does not match since ID is not the 'Display Value' in ServiceNow, however I feel like the reference attribute should solve this.
The error we get:
I would accept this error, if it wasn't for the section which I have marked in the middle.
It describes our scenario specifically, unless I am misunderstanding?
Has anyone done anything similar or experience anything like this?
We have managed to work-around this issue by syncing the value on the user table and instead running business rules to match a user to a department in ServiceNow - however this loses a bit of functionality and should, in my opinion, not be necessary.
Note: The provisioning would work if we changed 'Display Value' to Department ID instead of Department Name, but I would not like to do this for obvious reasons.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2025 01:42 PM
@kristianden curious if you ever worked this out in a manner satisfactory to you. We're seeing the same today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 01:13 AM
Hello @imbruck
Unfortunately, a solution in the Entra provision function was never provided.
However, we found a workaround which works pretty good.
What we do is add a new field on the user called 'Department ID'
We provision the hdsDepartmentNumber to this on the sys_user table.
(As said, this value is the same as 'id' on the cmn_department table.)
Now we have a user with the ID, and the department with the respective ID will get added to the user through this business rule:
This works fine and is much better than managing the correct department names in AD. Hope this helps, let me know if you have any further questions.