Map external users to Port accounts
This guide demonstrates how to map external users from Git, Jira, Slack, ServiceNow, and HiBob to existing Port user accounts.
Common use cases
- Maintain a complete inventory of external users in Port.
- Link external tool users to Port user accounts based on email addresses.
- Identify users who exist in external tools but do not have Port accounts.
- Enrich Port user entities with context from Git, Jira, Slack, ServiceNow, and HiBob.
Prerequisites
Before you start, make sure:
- You have a Port account and have completed the onboarding process.
- You have permissions to create or update blueprints, self-service actions, and automations in Port.
- You have installed the relevant integration or have admin/API access to the external tool you want to map.
Map users by integration
Choose the tab for the external tool you want to map. Each tab is an implementation path for the same outcome: linking external users to Port user accounts.
- Git
- Jira
- Slack
- ServiceNow
- HiBob
Git users
Use this option to map GitHub, GitLab, and Azure DevOps users to Port user accounts by matching email addresses.
Set up Git prerequisites
Install and configure the relevant Git integration:
- GitHub (Ocean)
- GitHub (Sunset)
- Port's GitLab integration.
- Port's Azure DevOps integration.
- You have permissions to create automations in Port.
Set up data model
The relations between Git users and Port users are created automatically when we install the relevant Git integrations. If you haven't installed them yet, please do so first.
Optional: Add mirror properties to the Port User blueprint
If you want to display some Git user attributes e.g. username, email, etc. in the Port User blueprint, you can add a mirror property to the Port User blueprint.
Follow the steps below to add a mirror property to the Port User blueprint:
-
Go to the data model page of your portal.
-
Find the
Userblueprint and click on it. -
Click on the Edit JSON button in the top right corner.
-
Add the following mirror properties to the
mirrorPropertiesobject to display Git user information:Port User blueprint mirror properties (Click to expand)
"mirrorProperties": {"github_login": {"title": "GitHub login","path": "githubUser.login"},"gitlab_username": {"title": "GitLab username","path": "gitlabUser.username"},"azuredevops_display_name": {"title": "Azure DevOps display name","path": "azureDevopsUser.displayName"}} -
Click on Save to update the blueprint.
You can add more mirror properties to display other Git user attributes or customize which properties are most relevant for your organization. Only add the mirror properties for the Git platforms you're using.
Update integration mapping
Now we'll update the integration mapping to include the relation and create automations to sync Git users when a new Port user is added.
- GitHub (Ocean)
- GitHub (Sunset)
- GitLab
- Azure DevOps
To update the GitHub Ocean integration mapping, follow the steps below:
-
Go to the Data sources page.
-
Under Exporters, click on your installed GitHub Ocean integration.
-
In the mapping configuration, add a new mapping for Port User entities to establish the relation with GitHub users:
Updated GitHub Ocean integration mapping (Click to expand)
# Keep existing githubUser mapping- kind: userselector:query: 'true'port:entity:mappings:identifier: .logintitle: .loginblueprint: '"githubUser"'properties:email: .email# Add new mapping for Port Users with relation to GitHub users- kind: userselector:query: '.email != null'port:entity:mappings:identifier: .emailblueprint: '"_user"'relations:githubUser: .login -
Click on Save & Resync to apply the changes.
To update the GitHub integration mapping, follow the steps below:
-
Go to the Data sources page.
-
Find your GitHub integration and click on it.
-
In the mapping configuration, add a new mapping for Port User entities to establish the relation with GitHub users:
Updated GitHub integration mapping (Click to expand)
# Keep existing githubUser mapping- kind: userselector:query: 'true'port:entity:mappings:identifier: .logintitle: .loginblueprint: '"githubUser"'properties:email: .email# Add new mapping for Port Users with relation to GitHub users- kind: userselector:query: '.email != null'port:entity:mappings:identifier: .emailblueprint: '"_user"'relations:githubUser: .login -
Click on Save & Resync to apply the changes.
To update the GitLab integration mapping, follow the steps below:
-
Go to the Data sources page.
-
Find your GitLab integration and click on it.
-
In the mapping configuration, add a new mapping for Port User entities to establish the relation with GitLab users:
Updated GitLab integration mapping (Click to expand)
# Keep existing gitlabMember mapping- kind: memberselector:query: 'true'port:entity:mappings:identifier: .usernametitle: .nameblueprint: '"gitlabMember"'properties:url: .web_urlstate: .stateemail: .emaillocked: .locked# Add new mapping for Port Users with relation to GitLab users- kind: memberselector:query: '.email != null'port:entity:mappings:identifier: .emailblueprint: '"_user"'relations:gitlabUser: .username -
Click on Save & Resync to apply the changes
To update the Azure DevOps integration mapping, follow the steps below:
-
Go to the Data sources page.
-
Find your Azure DevOps integration and click on it.
-
In the mapping configuration, add a new mapping for Port User entities to establish the relation with Azure DevOps users:
Updated Azure DevOps integration mapping (Click to expand)
# Keep existing azureDevopsMember mapping- kind: userselector:query: 'true'port:entity:mappings:identifier: .idtitle: .user.displayNameblueprint: '"azureDevopsMember"'properties:url: .user.urlemail: .user.mailAddress# Add new mapping for Port Users with relation to Azure DevOps users- kind: userselector:query: '.user.mailAddress != null'port:entity:mappings:identifier: .user.mailAddressblueprint: '"_user"'relations:azureDevopsUser: .id -
Click on Save & Resync to apply the changes.
Set up automation
To ensure new Port users are automatically mapped to their corresponding Git user accounts when a new Port user is created, we'll create an automation that triggers when a new Port user is created.
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Automation to sync Port users to Git user accounts (Click to expand)
{"identifier": "sync_port_user_for_git_users","title": "Sync Port User for Git Users","description": "Automatically maps Port users to their corresponding Git user accounts across all platforms","icon": "Git","trigger": {"type": "automation","event": {"type": "ENTITY_CREATED","blueprintIdentifier": "_user"},"condition": {"type": "JQ","expressions": [],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "https://api.port.io/v1/entities/_user/{{ .event.diff.after.identifier }}/relations","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"relations": {"githubUser": {"combinator": "and","rules": [{"property": "$identifier","operator": "=","value": "{{ .event.diff.after.identifier }}"}]},"gitlabUser": {"combinator": "and","rules": [{"property": "$identifier","operator": "=","value": "{{ .event.diff.after.identifier }}"}]},"azureDevopsUser": {"combinator": "and","rules": [{"property": "$identifier","operator": "=","value": "{{ .event.diff.after.identifier }}"}]}}}},"publish": true}Select the relevant Git integrationIn this automation example, we show how to map Port users to all supported Git platforms (GitHub, GitLab, and Azure DevOps) at once. In practice, you should only configure the relation for the Git platform your organization actually uses. For example, if your users are only in GitHub, include the
githubUserrelation and remove the others. Adjust the configuration to match your organization's setup. -
Click Save to create the automation.
Let's test it!
-
Go to your Software catalog page
-
Search for a Git user entity (e.g.,
GitHub User,GitLab User, orAzure DevOps User) -
Verify that the user has a relationship with the corresponding Port user account.
-
Check that the relationship is established automatically for new Git users.
Jira users
Use this option to map Jira users to Port user accounts by matching email addresses.
Set up Jira prerequisites
- You have Port's Jira integration installed and configured.
- You have permissions to create automations in Port.
Set up data model
The relation between Jira users and Port users is created automatically when we install the Jira integration. If you haven't installed it yet, please do so first.
Optional: Add mirror properties to the Port User blueprint
If you want to display some Jira user attributes e.g. display name, account type, time zone, etc. in the Port User blueprint, you can add a mirror property to the Port User blueprint.
Follow the steps below to add a mirror property to the Port User blueprint:
-
Go to the data model page of your portal.
-
Find the
Userblueprint and click on it. -
Click on the Edit JSON button in the top right corner.
-
Add the following mirror property to the
mirrorPropertiesobject to display the Jira display name:Port User blueprint mirror property (Click to expand)
"mirrorProperties": {"jira_display_name": {"title": "Jira display name","path": "jiraUser.displayName"}} -
Click on Save to update the blueprint.
You can add more mirror properties to display other Jira user attributes like timezone (jiraUser.timeZone), account type (jiraUser.accountType), or any other property from the Jira User blueprint that would be useful for your organization.
Update Jira integration mapping
-
Go to the data sources page.
-
Find your Jira integration and click on it.
-
In the mapping configuration, add a new mapping for Port User entities to establish the relation with Jira users.
Updated Jira integration mapping (Click to expand)
# Keep existing jiraUser mapping- kind: userselector:query: 'true'port:entity:mappings:identifier: .accountIdtitle: .displayNameblueprint: '"jiraUser"'properties:emailAddress: .emailAddressactive: .activeaccountType: .accountTypetimeZone: .timeZonelocale: .localeavatarUrl: .avatarUrls["48x48"]# Add new mapping for Port Users with relation to Jira users- kind: userselector:query: '.emailAddress != null'port:entity:mappings:identifier: .emailAddressblueprint: '"_user"'relations:jiraUser: .accountId -
Click on Save & Resync to apply the changes.
Set up automations
To ensure new Port users are automatically mapped to their corresponding Jira user accounts when a new Port user is created, we'll create an automation that triggers when a new Port user is created.
Follow the steps below to create the automation:
-
Go to the automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Automation to sync Port users to Jira user account (Click to expand)
{"identifier": "sync_port_user_for_jira_user","title": "Sync Port User for Jira User","description": "Automatically maps Port users to their corresponding Jira user accounts","icon": "Jira","trigger": {"type": "automation","event": {"type": "ENTITY_CREATED","blueprintIdentifier": "_user"},"condition": {"type": "JQ","expressions": [],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "https://api.port.io/v1/entities/_user/{{ .event.diff.after.identifier }}/relations","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"relations": {"jiraUser": {"combinator": "and","rules": [{"property": "$identifier","operator": "=","value": "{{ .event.diff.after.identifier }}"}]}}}},"publish": true} -
Click Save to create the automation.
Let's test it
-
Go to the Catalog page in Port.
-
Search for a Jira user entity.
-
Verify that the user has a relationship with the corresponding Port user account.
-
Check that the relationship is established automatically for new Jira users.
Slack users
Use this option to ingest Slack users through a webhook integration and map them to Port user accounts.
This path uses Port's custom webhook integration, self-service actions, and automations.
Set up Slack prerequisites
- You have Slack workspace permissions to create apps and generate bot tokens. See the Slack app quickstart.
- You have permissions to create blueprints, self-service actions, and automations in Port.
Set up data model
To represent Slack users in your portal, we need to create a Slack User blueprint that can store Slack user data and optionally link to Port user accounts.
Create the Slack user blueprint
-
Go to the data model page of your portal.
-
Click on + Blueprint.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following JSON schema:
Slack user blueprint (Click to expand)
{"identifier": "slack_user","description": "Slack User","title": "Slack User","icon": "Slack","schema": {"properties": {"tz": {"type": "string","description": "The user's time zone."},"is_restricted": {"type": "boolean","description": "Indicates if the user is restricted."},"is_primary_owner": {"type": "boolean","description": "Indicates if the user is the primary owner."},"real_name": {"type": "string","description": "The user's real name."},"team_id": {"type": "string","description": "The user's team ID."},"is_admin": {"type": "boolean","description": "Indicates if the user is an admin."},"is_app_user": {"type": "boolean","description": "Indicates if the user is an app user."},"deleted": {"type": "boolean","description": "Indicates if the user is deleted."},"is_bot": {"type": "boolean","description": "Indicates if the user is a bot."},"email": {"type": "string","title": "Email","description": "The user's email address"}},"required": []},"mirrorProperties": {},"calculationProperties": {},"aggregationProperties": {},"relations": {}} -
Click on Save to create the blueprint.
Enhance the Port User blueprint
Now we need to enhance the Port User blueprint to add a relation to the Slack User blueprint and mirror properties to display Slack information.
-
Go to the data model page of your portal.
-
Find the
Userblueprint and click on it. -
Click on the Edit JSON button in the top right corner.
-
Add the following relation to the
relationsobject:Port User blueprint relation (Click to expand)
"relations": {"slack_user": {"title": "Slack User","target": "slack_user","required": false,"many": false}} -
Add the following mirror property to the
mirrorPropertiesobject to display the Slack real name:Port User blueprint mirror property (Click to expand)
"mirrorProperties": {"slack_real_name": {"title": "Slack real name","path": "slack_user.real_name"}} -
Click on Save to update the blueprint.
You can add more mirror properties to display other Slack user attributes like timezone (slack_user.tz), admin status (slack_user.is_admin), or any other property from the Slack User blueprint that would be useful for your organization.
Add Port secrets
Now let's add your Slack bot token to Port's secrets:
-
In your Port application, click on your profile picture
.
-
Click on Credentials.
-
Click on the Secrets tab.
-
Click on + Secret and add the following secret:
SLACK_BOT_TOKEN- Your Slack bot token withusers:readandusers:read.emailscopes. How to get the token
Set up webhook integration
We'll create a webhook integration that can ingest multiple Slack users at once and automatically establish relationships with existing Port users.
Follow the steps below to create the webhook integration:
-
Go to the Data Sources page.
-
Click on + Data Source.
-
Select Webhook and click on Custom integration.
-
Name it "Slack Users Sync".
-
Copy the webhook URL - you'll need this for the automation.
-
Copy and paste the following mapping into the Map the data from the external system into Port field:
Slack users webhook mapping (Click to expand)
[{"blueprint": "slack_user","operation": "create","filter": "(.body.response | has(\"members\")) and (.body.response.members | type == \"array\")","itemsToParse": ".body.response.members | map(select(.deleted == false))","entity": {"identifier": ".item.id | tostring","title": ".item.name | tostring","properties": {"tz": ".item.tz","is_restricted": ".item.is_restricted","is_primary_owner": ".item.is_primary_owner","real_name": ".item.real_name","team_id": ".item.team_id","is_admin": ".item.is_admin","is_app_user": ".item.is_app_user","deleted": ".item.deleted","is_bot": ".item.is_bot","email": ".item.profile.email"}}},{"blueprint": "_user","operation": "create","filter": "(.body.response | has(\"members\")) and (.body.response.members | type == \"array\")","itemsToParse": ".body.response.members | map(select(.deleted == false and .profile.email != null))","entity": {"identifier": ".item.profile.email","relations": {"slack_user": ".item.id | tostring"}}},{"blueprint": "slack_user","operation": "create","filter": ".body.response.user != null","entity": {"identifier": ".body.response.user.id | tostring","title": ".body.response.user.name | tostring","properties": {"tz": ".body.response.user.tz","is_restricted": ".body.response.user.is_restricted","is_primary_owner": ".body.response.user.is_primary_owner","real_name": ".body.response.user.real_name","team_id": ".body.response.user.team_id","is_admin": ".body.response.user.is_admin","is_app_user": ".body.response.user.is_app_user","deleted": ".body.response.user.deleted","is_bot": ".body.response.user.is_bot","email": ".body.response.user.profile.email"}}},{"blueprint": "_user","operation": "create","filter": ".body.response.user != null and .body.response.user.profile.email != null","entity": {"identifier": ".body.response.user.profile.email","relations": {"slack_user": ".body.response.user.id | tostring"}}}] -
Click on Save.
When the webhook processes Slack users, it will automatically create Port User entities for any Slack users that don't already exist in your Port organization. These newly created Port users will have a Disabled status by default, meaning they won't receive email invitations and won't be able to access Port until an admin manually activates their accounts.
Set up self-service actions
We'll create two self-service actions in this section, one for fetching Slack users and another for fetching a Slack user via email for the automation and webhook to ingest data.
Sync Slack users self-service action
This action fetches all Slack users and sends the response to the process Slack users automation for processing.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Sync Slack Users action (Click to expand)
{"identifier": "sync_slack_users","title": "Sync Slack Users","icon": "Slack","description": "Fetch and sync all Slack users to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {},"required": [],"order": []}},"invocationMethod": {"type": "WEBHOOK","url": "https://slack.com/api/users.list","agent": false,"synchronized": true,"method": "GET","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Authorization": "Bearer {{ .secrets.SLACK_BOT_TOKEN}}"},"body": {}},"requiredApproval": false} -
Click Save to create the action.
Get Slack user by email self-service action
This action fetches a single Slack user by email and send the response to a process single Slack user automation for processing.
This is required if you want to automate the process of making newly created Port users sync with their corresponding Slack user accounts by fetching the slack user by email and sending them to the automation for data ingestion.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Get Slack user by email action (Click to expand)
{"identifier": "get_single_slack_user","title": "Get Slack User by Email","icon": "Slack","description": "Fetch a Slack user to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {"email": {"icon": "DefaultProperty","type": "string","title": "Email of user","description": "Email of the slack user"}},"required": [],"order": ["email"]}},"invocationMethod": {"type": "WEBHOOK","url": "https://slack.com/api/users.lookupByEmail?email={{ .inputs.email }}","synchronized": true,"method": "GET","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Authorization": "Bearer {{ .secrets.SLACK_BOT_TOKEN}}"},"body": {}},"requiredApproval": false} -
Click Save to create the action.
Set up automations
Now we'll create the automations that process the Slack users list and sends the response to the webhook for bulk ingestion and single user ingestion.
Bulk ingest Slack users
This automation will trigger when the Sync Slack users action is executed. It will then process the Slack users list and send the response to the webhook for bulk ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process Slack users automation (Click to expand)
Replace the webhook URLReplace the webhook URL with the one you created in the previous step.
{"identifier": "process_slack_users","title": "Process Slack Users","description": "Processes Slack users list and sends to webhook for bulk ingestion","icon": "Slack","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "sync_slack_users"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\"",".diff.after.response.ok == true"],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Process a single Slack user
This automation will trigger when the Get Slack user by email action is executed. It will then process the Slack user and send the response to the webhook for single user ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process single Slack user automation (Click to expand)
{"identifier": "process_single_slack_user","title": "Process Single Slack Users","description": "Processes Slack user and sends to webhook for ingestion","icon": "Slack","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "get_single_slack_user"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\"",".diff.after.response.ok == true"],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Sync Slack users when a new Port user is added
To ensure new Port users get mapped to Slack users automatically, we'll create an automation that triggers when a new Port user is created. This automation will trigger the Get Slack user by email action to fetch details of the Slack user by email and trigger the process single Slack user automation for processing.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Automation to sync Slack users when a new Port user is added (Click to expand)
{"identifier": "ingest_slack_user","title": "Trigger slack_user ingestion automation","description": "This will call the webhook endpoint to ingest a single slack user","icon": "Slack","trigger": {"type": "automation","event": {"type": "ENTITY_CREATED","blueprintIdentifier": "_user"},"condition": {"type": "JQ","expressions": [],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "https://api.port.io/v1/actions/get_single_slack_user/runs","agent": false,"synchronized": true,"method": "POST","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json"},"body": {"properties": {"email": "{{ .event.diff.after.identifier }}"}}},"publish": true} -
Click Save to create the automation.
Let's test it
-
Go to the Self-service page.
-
Find the "Sync Slack Users" action.
-
Click Execute.
-
Monitor the action execution in the Audit logs page.
-
Verify that Slack users are created in your catalog with proper relationships.
-
Verify that the Slack user is created in your catalog with proper relationships.
ServiceNow users
Use this option to ingest ServiceNow users through a webhook integration and map them to Port user accounts by matching email addresses.
This path uses Port's custom webhook integration, self-service actions, and automations.
Set up ServiceNow prerequisites
- You have a ServiceNow instance with admin permissions to access the user table. Learn about ServiceNow REST API.
- You have permissions to create blueprints, self-service actions, and automations in Port.
Set up data model
To represent ServiceNow users in your portal, we need to create a ServiceNow User blueprint that can store ServiceNow user data and optionally link to Port user accounts.
Create the ServiceNow user blueprint
-
Go to the data model page of your portal.
-
Click on + Blueprint.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following JSON schema:
ServiceNow user blueprint (Click to expand)
{"identifier": "servicenow_user","description": "ServiceNow User","title": "ServiceNow User","icon": "Servicenow","schema": {"properties": {"user_name": {"type": "string","title": "Username","description": "The user's login name"},"name": {"type": "string","title": "Full Name","description": "The user's full display name"},"first_name": {"type": "string","title": "First Name","description": "The user's first name"},"last_name": {"type": "string","title": "Last Name","description": "The user's last name"},"email": {"type": "string","title": "Email","description": "The user's email address"},"employee_number": {"type": "string","title": "Employee Number","description": "The user's employee number"},"active": {"type": "boolean","title": "Active","description": "Indicates if the user is active"},"locked_out": {"type": "boolean","title": "Locked Out","description": "Indicates if the user account is locked"},"vip": {"type": "boolean","title": "VIP","description": "Indicates if the user has VIP status"},"password_needs_reset": {"type": "boolean","title": "Password Reset Required","description": "Indicates if the user's password needs to be reset"},"last_login": {"type": "string","title": "Last Login","description": "The user's last login time"},"phone": {"type": "string","title": "Phone","description": "The user's phone number"},"mobile_phone": {"type": "string","title": "Mobile Phone","description": "The user's mobile phone number"},"department": {"type": "string","title": "Department","description": "The user's department"},"title": {"type": "string","title": "Job Title","description": "The user's job title"},"manager": {"type": "string","title": "Manager","description": "The user's manager"},"location": {"type": "string","title": "Location","description": "The user's location"},"company": {"type": "string","title": "Company","description": "The user's company"},"roles": {"type": "string","title": "Roles","description": "The user's roles and permissions"},"time_zone": {"type": "string","title": "Time Zone","description": "The user's time zone"},"sys_created_on": {"type": "string","title": "Created On","description": "When the user was created"},"sys_updated_on": {"type": "string","title": "Updated On","description": "When the user was last updated"},"sys_updated_by": {"type": "string","title": "Updated By","description": "Who last updated the user record"},"failed_attempts": {"type": "string","title": "Failed Login Attempts","description": "Number of failed login attempts"}},"required": []},"mirrorProperties": {},"calculationProperties": {},"aggregationProperties": {},"relations": {}} -
Click on Save to create the blueprint.
Enhance the Port User blueprint
Now we need to enhance the Port User blueprint to add a relation to the ServiceNow User blueprint and mirror properties to display ServiceNow information.
-
Go to the data model page of your portal.
-
Find the
Userblueprint and click on it. -
Click on the Edit JSON button in the top right corner.
-
Add the following relation to the
relationsobject:Port User blueprint relation (Click to expand)
"relations": {"servicenow_user": {"title": "ServiceNow User","target": "servicenow_user","required": false,"many": false}} -
Add the following mirror property to the
mirrorPropertiesobject to display the ServiceNow full name:Port User blueprint mirror property (Click to expand)
"mirrorProperties": {"servicenow_full_name": {"title": "ServiceNow full name","path": "servicenow_user.name"}} -
Click on Save to update the blueprint.
You can add more mirror properties to display other ServiceNow user attributes like department (servicenow_user.department), job title (servicenow_user.title), or any other property from the ServiceNow User blueprint that would be useful for your organization.
Add Port secrets
Now let's add your ServiceNow credentials to Port's secrets:
- In your Port application, click on your profile picture
.
- Click on Credentials.
- Click on the Secrets tab.
- Click on + Secret and add the following secrets:
SERVICENOW_INSTANCE_URL- Your ServiceNow instance URL (e.g., https://your-instance.service-now.com)SERVICENOW_API_TOKEN- A base64 encoded string of your ServiceNow credentials generated as:echo -n "your-instance-username:your-instance-password" | base64
Set up webhook integration
We'll create a webhook integration that can ingest multiple ServiceNow users at once and automatically establish relationships with existing Port users.
Follow the steps below to create the webhook integration:
-
Go to the Data Sources page.
-
Click on + Data Source.
-
Select Webhook and click on Custom integration.
-
Name it "ServiceNow Users Sync".
-
Copy the webhook URL - you'll need this for the automation.
-
Copy and paste the following mapping into the Map the data from the external system into Port field:
ServiceNow users webhook mapping (Click to expand)
[{"blueprint": "servicenow_user","operation": "create","filter": "(.body.response | has(\"result\")) and (.body.response.result | type == \"array\")","itemsToParse": ".body.response.result | map(select(.active == \"true\"))","entity": {"identifier": ".item.sys_id | tostring","title": ".item.user_name | tostring","properties": {"user_name": ".item.user_name","name": ".item.name","first_name": ".item.first_name","last_name": ".item.last_name","email": ".item.email","employee_number": ".item.employee_number","active": ".item.active","locked_out": ".item.locked_out","vip": ".item.vip","failed_attempts": ".item.failed_attempts","password_needs_reset": ".item.password_needs_reset","last_login": ".item.last_login","phone": ".item.phone","mobile_phone": ".item.mobile_phone","department": "if .item.department | type == \"object\" then .item.department.value else .item.department end","title": ".item.title","manager": "if .item.manager | type == \"object\" then .item.manager.value else .item.manager end","location": "if .item.location | type == \"object\" then .item.location.value else .item.location end","company": "if .item.company | type == \"object\" then .item.company.value else .item.company end","roles": ".item.roles","time_zone": ".item.time_zone","sys_created_on": ".item.sys_created_on","sys_updated_on": ".item.sys_updated_on","sys_updated_by": ".item.sys_updated_by"}}},{"blueprint": "_user","operation": "create","filter": "(.body.response | has(\"result\")) and (.body.response.result | type == \"array\")","itemsToParse": ".body.response.result | map(select(.active == \"true\" and .email != null))","entity": {"identifier": ".item.email","relations": {"servicenow_user": ".item.sys_id | tostring"}}}] -
Click on Save.
When the webhook processes ServiceNow users, it will automatically create Port User entities for any ServiceNow users that don't already exist in your Port organization. These newly created Port users will have a Disabled status by default, meaning they won't receive email invitations and won't be able to access Port until an admin manually activates their accounts.
Set up self-service actions
We'll create two self-service actions in this section, one for fetching ServiceNow users and another for fetching a ServiceNow user via email for the automation and webhook to ingest data.
Sync ServiceNow users self-service action
This action fetches all ServiceNow users and send them to the process ServiceNow users automation for processing. The automation will then send the response to the webhook for ingestion.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Sync ServiceNow Users action (Click to expand)
{"identifier": "sync_servicenow_users","title": "Sync ServiceNow Users","icon": "Servicenow","description": "Fetch and sync all ServiceNow users to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {"sysparm_limit": {"icon": "DefaultProperty","type": "number","title": "Results returned per page","description": "The maximum number of results returned per page (default: 10,000)"}},"required": [],"order": ["sysparm_limit"]}},"invocationMethod": {"type": "WEBHOOK","url": "{{ .secrets.SERVICENOW_INSTANCE_URL }}/api/now/table/sys_user?sysparm_query=ORDERBYDESCsys_created_on&sysparm_limit={{ .inputs.sysparm_limit }}","agent": false,"synchronized": true,"method": "GET","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Accept": "application/json","Authorization": "Basic {{ .secrets.SERVICENOW_API_TOKEN }}"},"body": {}},"requiredApproval": false} -
Click Save to create the action.
Get ServiceNow user by email self-service action
This action fetches a single ServiceNow user by email and send the response to a process single ServiceNow user automation for processing. The automation will then send the response to the webhook for ingestion.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Get ServiceNow user by email action (Click to expand)
{"identifier": "get_single_servicenow_user","title": "Get ServiceNow User by Email","icon": "Servicenow","description": "Fetch a ServiceNow user to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {"email": {"icon": "DefaultProperty","type": "string","title": "Email of user","description": "Email of the service now user"}},"required": [],"order": ["email"]}},"invocationMethod": {"type": "WEBHOOK","url": "{{ .secrets.SERVICENOW_INSTANCE_URL }}/api/now/table/sys_user?sysparm_query=email={{ .inputs.email }}&sysparm_limit=1","synchronized": true,"method": "GET","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Accept": "application/json","Authorization": "Basic {{ .secrets.SERVICENOW_API_TOKEN }}"},"body": {}},"requiredApproval": false} -
Click Save to create the action.
Set up automations
Now we'll create the automations that process the ServiceNow users list and sends the response to the webhook for bulk ingestion and single user ingestion.
Bulk ingest ServiceNow users
This automation will trigger when the Sync ServiceNow users action is executed. It will then process the ServiceNow users list and send the response to the webhook for bulk ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process ServiceNow users automation (Click to expand)
Replace the webhook URLReplace the webhook URL with the one you created in the previous step.
{"identifier": "process_servicenow_users","title": "Process ServiceNow Users","description": "Processes ServiceNow users list and sends to webhook for bulk ingestion","icon": "Servicenow","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "sync_servicenow_users"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\""],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Process a single ServiceNow user
This automation will trigger when the Get ServiceNow user by email action is executed. It will then process the ServiceNow user and send the response to the webhook for single user ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process single ServiceNow user automation (Click to expand)
{"identifier": "process_single_servicenow_user","title": "Process Single ServiceNow Users","description": "Processes ServiceNow user and sends to webhook for ingestion","icon": "Servicenow","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "get_single_servicenow_user"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\""],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Sync ServiceNow users when a new Port user is added
To ensure new Port users get mapped to ServiceNow users automatically, we'll create an automation that triggers when a new Port user is created. This automation will trigger the Get ServiceNow user by email action to fetch details of the ServiceNow user by email and trigger the process single ServiceNow user automation for processing.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Automation to sync ServiceNow users when a new Port user is added (Click to expand)
{"identifier": "ingest_servicenow_user","title": "Trigger servicenow_user ingestion automation","description": "This will call the webhook endpoint to ingest a single service now user","icon": "Servicenow","trigger": {"type": "automation","event": {"type": "ENTITY_CREATED","blueprintIdentifier": "_user"},"condition": {"type": "JQ","expressions": [],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "https://api.port.io/v1/actions/get_single_servicenow_user/runs","agent": false,"synchronized": true,"method": "POST","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json"},"body": {"properties": {"email": "{{ .event.diff.after.identifier }}"}}},"publish": true} -
Click Save to create the automation.
Let's test it
-
Go to the Self-service page.
-
Find the "Sync ServiceNow Users" action.
-
Enter the number of records you want to fetch and click Execute.
-
Monitor the action execution in the Audit logs page.
-
Verify that ServiceNow users are created in your catalog with proper relationships.
HiBob users
Use this option to ingest HiBob users through a webhook integration and map them to Port user accounts by matching email addresses.
This path uses Port's custom webhook integration, self-service actions, and automations.
Set up HiBob prerequisites
- You have a HiBob instance with admin permissions to create service users and configure permissions. Learn about HiBob API Service Users.
- You have created a HiBob service user with appropriate permissions to access employee data via the People search API.
- You have permissions to create blueprints, self-service actions, and automations in Port.
Set up data model
To represent HiBob users in your portal, we need to create a HiBob User blueprint that can store HiBob user data and optionally link to Port user accounts.
Create the HiBob user blueprint
-
Go to the data model page of your portal.
-
Click on + Blueprint.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following JSON schema:
HiBob user blueprint (Click to expand)
{"identifier": "hibob_user","description": "HiBob User","title": "HiBob User","icon": "User","schema": {"properties": {"id": {"type": "string","title": "ID","description": "The user's unique identifier"},"firstName": {"type": "string","title": "First Name","description": "The user's first name"},"email": {"type": "string","title": "Email","description": "The user's email address"},"department": {"type": "string","title": "Department","description": "The user's department"},"isManager": {"type": "string","title": "Is Manager","description": "Indicates if the user is a manager"},"work_title": {"type": "string","title": "Job Title","description": "The user's job title"},"fullName": {"type": "string","title": "Full Name","description": "The user's full name"},"displayName": {"type": "string","title": "Display Name","description": "The user's display name"}},"required": []},"mirrorProperties": {},"calculationProperties": {},"aggregationProperties": {},"relations": {}} -
Click on Save to create the blueprint.
Enhance the Port User blueprint
Now we need to enhance the Port User blueprint to add a relation to the HiBob User blueprint and mirror properties to display HiBob information.
-
Go to the data model page of your portal.
-
Find the
Userblueprint and click on it. -
Click on the Edit JSON button in the top right corner.
-
Add the following relation to the
relationsobject:Port User blueprint relation (Click to expand)
"relations": {"hibob_user": {"title": "HiBob User","target": "hibob_user","required": false,"many": false}} -
Add the following mirror property to the
mirrorPropertiesobject to display the HiBob display name:Port User blueprint mirror property (Click to expand)
"mirrorProperties": {"hibob_display_name": {"title": "HiBob display name","path": "hibob_user.displayName"}} -
Click on Save to update the blueprint.
You can add more mirror properties to display other HiBob user attributes like job title (hibob_user.work_title), department (hibob_user.department), manager status (hibob_user.isManager), or any other property from the HiBob User blueprint that would be useful for your organization.
Add Port secrets
Now let's add your HiBob credentials to Port's secrets:
-
In your Port application, click on your profile picture
.
-
Click on Credentials.
-
Click on the Secrets tab.
-
Click on + Secret and add the following secrets:
HIBOB_API_URL- Your HiBob API base URL (e.g., https://api.hibob.com/v1)HIBOB_BASIC_AUTH- Your base64 encoded credentials (base64(HIBOB_SERVICE_USER_ID:HIBOB_SERVICE_USER_TOKEN))
echo -n "HIBOB_SERVICE_USER_ID:HIBOB_SERVICE_USER_TOKEN" | base64
HiBob uses Basic Authentication with base64 encoding. You'll need to create a service user in HiBob with appropriate permissions to access employee data, then encode the credentials as base64(service_user_id:service_user_token). Learn more about creating HiBob service users.
Set up webhook integration
We'll create a webhook integration that can ingest multiple HiBob users at once and automatically establish relationships with existing Port users.
Follow the steps below to create the webhook integration:
-
Go to the Data Sources page.
-
Click on + Data Source.
-
Select Webhook and click on Custom integration.
-
Name it "HiBob Users Sync".
-
Copy the webhook URL - you'll need this for the automation.
-
Copy and paste the following mapping into the Map the data from the external system into Port field:
HiBob users webhook mapping (Click to expand)
[{"blueprint": "hibob_user","operation": "create","filter": "(.body.response | has(\"employees\")) and (.body.response.employees | type == \"array\")","itemsToParse": ".body.response.employees | map(select(.email != null))","entity": {"identifier": ".item.id | tostring","title": ".item.displayName | tostring","properties": {"id": ".item.id","firstName": ".item.firstName","email": ".item.email","department": ".item.work.department","isManager": ".item.work.isManager","work_title": ".item.work.title","fullName": ".item.fullName","displayName": ".item.displayName"}}},{"blueprint": "_user","operation": "create","filter": "(.body.response | has(\"employees\")) and (.body.response.employees | type == \"array\")","itemsToParse": ".body.response.employees | map(select(.email != null))","entity": {"identifier": ".item.email","relations": {"hibob_user": ".item.id | tostring"}}}] -
Click on Save.
When the webhook processes HiBob users, it will automatically create Port User entities for any HiBob users that don't already exist in your Port organization. These newly created Port users will have a Disabled status by default, meaning they won't receive email invitations and won't be able to access Port until an admin manually activates their accounts.
Set up self-service actions
We'll create two self-service actions in this section, one for fetching HiBob users and another for fetching a HiBob user via email for the automation and webhook to ingest data.
Sync HiBob users self-service action
This action fetches all HiBob users and send them to the process HiBob users automation for processing. The automation will then send the response to the webhook for ingestion.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Sync HiBob Users action (Click to expand)
{"identifier": "sync_hibob_users","title": "Sync HiBob Users","icon": "User","description": "Fetch and sync all HiBob users to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {},"required": [],"order": []}},"invocationMethod": {"type": "WEBHOOK","url": "{{ .secrets.HIBOB_API_URL }}/people/search","agent": false,"synchronized": true,"method": "POST","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Authorization": "Basic {{ .secrets.HIBOB_BASIC_AUTH }}"},"body": {"showInactive": false,"fields": ["root.id","root.firstName","root.email","work.department","work.isManager","work.title","root.fullName","root.displayName"],"humanReadable": "REPLACE"}},"requiredApproval": false} -
Click Save to create the action.
Get HiBob user by email self-service action
This action fetches a single HiBob user by email and send the response to a process single HiBob user automation for processing. The automation will then send the response to the webhook for ingestion.
Follow the steps below to create the action:
-
Go to the Self-service page.
-
Click on + Action.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following action configuration:
Get HiBob user by email action (Click to expand)
{"identifier": "get_single_hibob_user","title": "Get HiBob User by Email","icon": "User","description": "Fetch a HiBob user to Port","trigger": {"type": "self-service","operation": "DAY-2","userInputs": {"properties": {"email": {"icon": "DefaultProperty","type": "string","title": "Email of user","description": "Email of the hibob user"}},"required": [],"order": ["email"]}},"invocationMethod": {"type": "WEBHOOK","url": "{{ .secrets.HIBOB_API_URL }}/people/search","synchronized": true,"method": "POST","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json","Authorization": "Basic {{ .secrets.HIBOB_BASIC_AUTH }}"},"body": {"showInactive": false,"fields": ["root.id","root.firstName","root.email","work.department","work.isManager","work.title","root.fullName","root.displayName"],"filters": [{"fieldPath": "root.email","operator": "equals","values": ["{{ .inputs.email }}"]}]}},"requiredApproval": false} -
Click Save to create the action.
Set up automations
Now we'll create the automations that process the HiBob users list and sends the response to the webhook for bulk ingestion and single user ingestion.
Bulk ingest HiBob users
This automation will trigger when the Sync HiBob users action is executed. It will then process the HiBob users list and send the response to the webhook for bulk ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process HiBob users automation (Click to expand)
Replace the webhook URLReplace the webhook URL with the one you created in the previous step.
{"identifier": "process_hibob_users","title": "Process HiBob Users","description": "Processes HiBob users list and sends to webhook for bulk ingestion","icon": "User","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "sync_hibob_users"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\""],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Process a single HiBob user
This automation will trigger when the Get HiBob user by email action is executed. It will then process the HiBob user and send the response to the webhook for single user ingestion.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Process single HiBob user automation (Click to expand)
{"identifier": "process_single_hibob_user","title": "Process Single HiBob Users","description": "Processes HiBob user and sends to webhook for ingestion","icon": "User","trigger": {"type": "automation","event": {"type": "RUN_UPDATED","actionIdentifier": "get_single_hibob_user"},"condition": {"type": "JQ","expressions": [".diff.after.status == \"SUCCESS\""],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "<YOUR_WEBHOOK_URL>","agent": false,"synchronized": true,"method": "POST","headers": {"Content-Type": "application/json"},"body": {"response": "{{ .event.diff.after.response }}"}},"publish": true} -
Click Save to create the automation.
Sync HiBob users when a new Port user is added
To ensure new Port users get mapped to HiBob users automatically, we'll create an automation that triggers when a new Port user is created. This automation will trigger the Get HiBob user by email action to fetch details of the HiBob user by email, which will then be processed by the webhook integration.
Follow the steps below to create the automation:
-
Go to the Automations page of your portal.
-
Click on + Automation.
-
Click on the Edit JSON button in the top right corner.
-
Copy and paste the following automation configuration:
Automation to sync HiBob users when a new Port user is added (Click to expand)
{"identifier": "ingest_hibob_user","title": "Trigger hibob_user ingestion automation","description": "This will trigger the Get HiBob user by email action to fetch and ingest a single HiBob user","icon": "User","trigger": {"type": "automation","event": {"type": "ENTITY_CREATED","blueprintIdentifier": "_user"},"condition": {"type": "JQ","expressions": [],"combinator": "and"}},"invocationMethod": {"type": "WEBHOOK","url": "https://api.port.io/v1/actions/get_single_hibob_user/runs","agent": false,"synchronized": true,"method": "POST","headers": {"RUN_ID": "{{ .run.id }}","Content-Type": "application/json"},"body": {"properties": {"email": "{{ .event.diff.after.identifier }}"}}},"publish": true} -
Click Save to create the automation.
Let's test it
-
Go to the Self-service page.
-
Find the "Sync HiBob Users" action.
-
Click Execute.
-
Monitor the action execution in the Audit logs page.
-
Verify that HiBob users are created in your catalog with proper relationships.