Skip to content

Instantly share code, notes, and snippets.

@jbdietrich
Last active December 14, 2015 11:59
Show Gist options
  • Save jbdietrich/5083081 to your computer and use it in GitHub Desktop.
Save jbdietrich/5083081 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$j('#_getButton').bind('click', function () {
var current_agent = "{{current_user.email}}";
search_url = "/api/v2/search.json?query=type%3Aticket%20status%3Csolved%20assignee%3A" + current_agent;
$j.get(search_url, function(data) {
alert(data.count + ' tickets assigned to you. First ticket URL is '+ data.results[0].url);
});
});
</script>
<input type="button" name="get" value="Get Agent's Tickets" id="_getButton">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment