Problem
You want to sync a second email address to Freshservice, or the sync fails when the primary and secondary email are the same.
Cause
Freshservice rejects a secondary email that is the same as the primary email, or that another user already has.
Steps
- Go to Enterprise applications > Freshservice Provisioning > Provisioning > Mappings > Provision Microsoft Entra ID Users.
- Click Show advanced options > Edit attribute list for Freshservice.
- Add an attribute named
urn:ietf:params:scim:schemas:extension:freshservice:2.0:User:_secondaryEmailwith type String. Save. The underscore is required. - Click Add New Mapping. Set the Target Attribute to
_secondaryEmailand the mapping type to Expression. - Enter this expression, so the primary email is never sent as the secondary one:
IIF([mail]=[userPrincipalName],"",[mail]) - Save and run Provision on demand for one user.
Errors
invalid_value"Cannot add ... to secondary_emails since it is primary email": the expression is missing.duplicate_valueonsecondary_emails: another user already has that address.
Sources
- KB: Mapping Custom Fields from Microsoft Entra ID to Freshservice
- KB: Duplicate Users After an Email Change: How to Fix