Flow ingests any user that has been associated with an imported repo or project. This could come in the form of a commit, comment, ticket subscription etc. This usually means there are users in your account that you do not recognize. This document will walk you through how to locate where a user was ingested from, using the API.
First, let's make sure you have access to the API and all its endpoints. You will need access to:
- Manage API keys
- API access - select all endpoints
With your permissions set, navigate to Settings then click Manage API keys and click on the link "Interactive API documentation can be found here".
A new tab will open and you will see all your API endpoints.
Locate the user ID
First we need to identify the unknown user's user_id so we can use that to locate any work he/she is associated with.
Step 1: Click on the very last endpoint users.
Step 2: A list of available parameters will appear. You can locate the user_id with the name or email of the user. Type in the name or email of the unknown user in the appropriate field. In this example we are using the email address.
Step 3: Hit "Enter" or click the Try it out button at the bottom of the parameter list.
Step 4: If you have typed in the name and/or email correctly you will see a result set like this for the unknown user. The user_id we need will be listed at the top of the results next to the parameter "id". Copy this number to your clipboard. We will be using this in the following steps.
Now that you have the user_id we can locate any work that has been imported for this user.
Let's check to see if the unknown user has any commits recorded across any of your imported repos.
Step 1: Scroll to the top of your API endpoint list and click on commits then click the top GET URL. This will open up the list of parameters for the commits endpoint.
Step 2: Locate the parameter apex_user_id. It will be towards the bottom of your parameter list. Paste in the user_id you copied in the last section and hit "Enter" or use the Try it out button to run the query.
Step 3: If any results appear you can identify what commits the unknown User authored by locating the "external_commit_url". This will take you into your Git host to review the work further. If there are commits for this User the results will look like this.
Success! You found the source of your unknown user
If there were 0 commits found for this user your response will look like this. Move on to the next section Pull requests to continue looking.
If the commits endpoint did not return any results. Let's continue the search in the pull request endpoint.
Step 1: Locate and click on the pull request endpoint.
Step 2: Find the apex_user_id parameter and paste in your user_id and hit "Enter" or use the Try it out button.
Step 3: Upon running your query you will either see results or you will not. If 0 PRs were found continue to the next endpoint. If results were found for this unknown user you have identified the origin source for the user.
If you have a ticket integration or use your Git host tickets/issues you can look for your unknown user in the tickets endpoints. Ticket endpoints require an user_alias_id. These are the aliases that have been 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.
Step 1. Under the user_alias endpoint locate the apex_user field and paste the user_id you have been using in the previous steps. Hit "Enter" or click the Try it out button.
Step 2: The results will show you all the aliases found for this apex_user. Copy and save all id's for later use:
Step 3: Now that we have all user_alias_ids for our unknown user let's see if we can locate any tickets. Open the tickets endpoint and locate the created_by_id field.
Step 4: Copy one of the user_alias_ids you saved from Step: 2 and hit "Enter" or Try it out to see if any records are found. Swap out each user_alias_id and try the apex_user_id (the original ID we got at the beginning of this guide). If records are found, great! If not continue on to the next endpoint.
Step 1: Locate and click on 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 ID's you input. Click Try it out to see the results.
If you have been unsuccessful in locating any data in the above endpoints, continue searching across the remaining endpoints listed below.
I did not find any data for the user
If you have not find any data in your account for this user, it could be that the data has been deleted/removed from your account. This can happen if the repo or project has been removed from your Flow account. If this the case, you should be able to delete this user as there is no data tying them to your account.You can do this on the User page.
If you need help, please email email@example.com for 24/7 assistance.