Who can use this?
Core | Plus | ||
✓ |
Fetch your apex users
The first step towards pulling data for your team is to use the users endpoint to grab the apex user ID’s for the users in the team. When multiple user records are associated with an individual, due to differences in email or variations in a name for example, user records can be merged under a single apex user record. The call below gets you a list of apex user id’s and the associated names for everyone in the team.
- YOUR_TEAM_NAME: This is the Flow team you are interested in. Of course you can use the users API to grab a different set of data, if that’s what you’re looking for.
- HOSTNAME :is the IP address or URL for the Flow application. If you’re using the cloud instance of Flow, this will be flow.pluralsight.com. If you’re using an on-premise version of Flow, this will be something other than flow.pluralsight.com.
- Format: creating comma delimited output for the sake of this document. Your implementation would likely use .json.
Your results will look something like this:
id,name 2081995,
Sally Smith 1905302,
Jessica Jones 2069030,
Sam Scales
Get all the sub aliases associated to that group
Once you have your list of apex users ( user_list ), you need to grab the sub-aliases that might be assigned to tickets.
Use this call to get the user data you need:
- HOSTNAME : Use the same hostname as you used in Step 1.
- YOUR_USER_LIST: This list of user ID’s that you got from Step 1. It should be comma separated.
- apex_user_id__in=101,102,445
The results here will be a much longer list that shows a complete list of users that your tickets may be logged under. It also shows a mapping to the main, apex User ID.
id,apex_user_id
2008481,2064975
2008482,2064975
2009588,1260734
2084711,2081995
2099206,1260734
Get your tickets
Once you have your complete list of users (complete_user_list ), you are ready to go and grab your tickets!
Use this call to get the ticket data you need:
- HOSTNAME : Use the same hostname as you used in Step 1.
- State: Your definition of state and closed may be different than this. It may be fine to just have a closed date and leave this out. Or you can use this API call to see what states you have:
- Complete_user_list: this is the complete list that you got in Step 2, comma delimited. In tickets, authors are stored in the assignee field.
- &assignees__in = 121,111,113,993
- YYYY-MM-DD: This is the date range that you’re interested. Looking for June 2018, you would use:
- &closed_at__gt=2018-06-01&closed_at__lt=2018-07-01
Tips:
- This request limits the results set to 1000 records. If you have more than 1000 records to return, use the pagination feature to grab the remaining pages of results. Learn more about pagination!
- When this is completed, go back and join this through the mapping that you got in Step 2 to get the unique, apex user.
Use aggregation for summary data
If you’re looking for summary data, you can use our aggregation features. Check-out the full API documentation for more information, but here is how you would get a count of tickets closed by month by user.
- HOSTNAME: Use the same hostname as you used in Step 1.
- State: See Step 3 for guidance.
- Complete_author_list: This is the complete list that you got in Step 2, comma delimited. In tickets, users are stored in the assignee field.
- &assignees__in = 121,111,113,993
- YYYY-MM-DD: This is the date range that you’re interested. Looking for June 2018, you would use:
- &closed_at__gt=2018-06-01&closed_at__lt=2018-07-01
When this is completed, go back and join this through the mapping that you got in Step 2 to get the unique, apex user.
Put it all together
Now you have everything you need. It’s time to put it all together. You should have data sets that look something like this:
- Join Step 1 Data to Step 2 data on ID to get a list of user aliases, apex users, and names.
- Join that data set you got in A to your Step 3 Data
- Roll that up by apex_user_id and you have data you can use.
If you need help, please contact Pluralsight Support.