Answered

Count of Tickets In a View/Team

  • 30 July 2022
  • 2 replies
  • 141 views

Hello,

 

I would like to be able to query a team to see how many tickets are in them at a given time. For example, we have an overnight queue and I would like to be able to alert on if that queue gets past a certain number.

 

Seems like I would want to add a tag using the rule and then query for tag count?

 

Thanks!

icon

Best answer by Racheal 1 August 2022, 23:49

View original

2 replies

Userlevel 4
Badge +5

Hey @user1387​ Racheal from the Support Engineer team here 👋

 

Have you checked out our Dashboard feature? You can filter by team and easily view open, snoozed, waiting for first response, and more all from one view! You can read more about the Dashboard here.

Badge +1

Hey Rose.

 

The count model currently doesn't support any filterability; it will only return the total number of conversations. I've provided this feedback though to Intercom so hopefully it will be updated soon.

 

In the meantime there is a way you can do what you'd like. I've set up this exact thing using some API calls and Zapier, so I'll describe the process below with Zapier in mind, but you may be able to achieve a similar thing with another method.

 

You can get a total count of conversations based on tag by using the Search for conversations model. You can use the field 'team_assignee_id' to filter by the specific team, or use 'tag_ids' to filter by tag.

Note: The tag_ids field requires the tags ID, and not the name of the tag. Be aware that on this page the example 'response' JSON shows a field called 'tags', however this does not actually exist. In order to find out what the ID of any given tag is, you will need to use the list all tags model, which you can then save the data to a sheet of sorts so you can see the IDs for all tags. You can't find the tag ID otherwise (maybe hidden in some code in inspect element, I haven't looked).

Once you have the ID for the tag you want, you can use this to filter conversations in the search for conversations model. This will return ALL conversation data, for whatever the filter parameters are, however it will also include a summary at the top of the request which will include the total count.

 

This is where I'd use Zapier to perform the request, and then parse the data only for the total count. In my case in order to achieve all of this, I have a Zapier set up to regularly sync tags with IDs, then a separate table with a list of specific tags I want the total volumes for which has the IDs sync'd. I then run a Zap which dynamically inserts the tag IDs into the POST request for search for conversations based on the tags in the table, and then narrows down the returned data to be just the total count and then syncs that with a new column in the sheet.

 

Filtering by team ID may be a bit easier, though as I have not tested it I am unsure if team ID truly means 'ID' (as in there is some number identifier) or just the name of the team. If it's the former, the process might be just as complicated.

 

For the last part, you can use Zapier to set an IF command that if the total tag/team ticket volume amount exceeds a certain value, to proceed to the next step. And you can just make the next step a slack or email notifier that says something like "Uh oh! Tickets are at {{insertnumberhere}}, can we get all hands on deck?". I have that set up as well.

 

Hope that all makes sense; as mentioned it's a bit contingent on Zapier, at least from the way I've done it. But if you have another means to do the parts that Zapier would do it wouldn't be too hard.

Reply