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

  1. Go to Enterprise applications > Freshservice Provisioning > Provisioning > Mappings > Provision Microsoft Entra ID Users.
  2. Click Show advanced options > Edit attribute list for Freshservice.
  3. Add an attribute named urn:ietf:params:scim:schemas:extension:freshservice:2.0:User:_secondaryEmail with type String. Save. The underscore is required.
  4. Click Add New Mapping. Set the Target Attribute to _secondaryEmail and the mapping type to Expression.
  5. Enter this expression, so the primary email is never sent as the secondary one:
    IIF([mail]=[userPrincipalName],"",[mail])
  6. 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_value on secondary_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