Flow ingests any user associated with an imported repo, PR project, or ticket project. Because Flow ingests users associated with repos and projects in multiple ways, you may not recognize every ingested user. This article shows you how to use the API to locate where a user was ingested from.
Note: In these examples, we call the API using the interactive documentation found via the API keys page in Flow. You can follow similar steps to call the API in your preferred client as needed.
Permissions
You need the Manage my API keys and API access permissions to locate unknown users in your data. You also need an active API key, especially if you use a third-party client to call the API.
Locate the user ID
First, identify the name or email of the user you want to locate. This information will be used to find the unknown user's user_id
.
- In the interactive documentation, navigate to the Users endpoint and click to expand the first
GET
operation for/users
. Click Try it out. - A list of available parameters appears. Type in the
name
oremail
of the unknown user. - Click Execute at the bottom of the parameter list.
- If you typed in the
name
oremail
correctly, you'll see a result set for the unknown user with theuser_id
listed at the top of the results next to the parameterid
. Copy this number to your clipboard. We'll use this in subsequent steps.
Now that you have the user_id
, we can locate any work that has been imported for this user.
Commits
Check to see if the unknown user has any commits recorded across any of your imported repos.
- In the interactive documentation, navigate to the Commits endpoint and click to expand the first
GET
operation for/commits
. Click Try it out. - Locate the parameter
apex_user_id
toward the bottom of your parameter list. Paste in theuser_id
you copied in the last section and click Execute to run the query. - If any results appear, identify what commits the unknown User authored by locating the
external_commit_url
in the response. Use this link to go to your Git host to review the work further.
Tip: There are a few other response fields that might be useful. count
is the total number of commits found for the user. hexsha
is the commit sha from the Git host.
If no commits were located for the user, your response will be empty.
If no records are returned for the user, look for the unknown user via Pull requests.
Pull requests
If the Commits endpoint didn't return any result, check the Pull requests endpoint. Follow the same steps as above but use the Pull requests endpoint. If no results are found, continue to the Tickets endpoint.
Tickets
If you have a ticket integration or use your Git host tickets and issues, look for your unknown user in the tickets endpoints. Ticket endpoints require a user_alias_id
. These are the aliases merged under the apex_user
. You should try the apex_user_id
and any user_alias_ids
to locate tickets, ticket events and/or ticket comments this unknown user may have made.
- Under the
user_alias
endpoint, locate theapex_user
field and paste theuser_id
you've been using in the previous steps. Click Execute. - The results show you all the aliases found for this
apex_user
.count
is the total number of aliases found for the user. Copy and save allid
s for later use. Id is the same asuser_alias_id
. - Now that we have all
user_alias_ids
for our unknown user, locate any tickets. Open the Tickets endpoint, click Try it out and locate thecreated_by_id
field. - Copy one of the
user_alias_ids
you saved from before and execute the query to see if any records are found. Swap out eachuser_alias_id
and try theapex_user_id
as well as the original ID you copied at the beginning of this guide. If records are not found, continue on to the next endpoint.
Ticket events
Locate and click the ticket_events endpoint. Find the user_alias_id
field and paste in one of your user_alias_ids
. You can also utilize the user_alias_id__in
field and paste in all your user_alias_id
s separated by a comma. This will look for any record across any of the IDs you input. Click Execute to see the results.
Next endpoints
If you couldn't locate any data in the above endpoints, continue searching across the remaining endpoints listed below.
- ticket_comments
- pull_request_events
- pull_request_comments
I did not find any data for the user
If you didn't find any data in your account for this user, the data may have been deleted or removed from your account. This can happen if the repo or project was removed from your Flow account. Remove this user from Flow if desired.