Solved

API Question about User Ticket Info


Userlevel 5
Badge +9

I have a script some of our agents run related to some stuff in Jamf (our mdm) that results in creating a ticket for the user, with their asset attached, and assigned to the agent who runs the script. This part works great. 

However, occasionally human error happens and the Agent has to run the script a second time resulting in a duplicate ticket.

Is there an endpoint in the API that can tell me if a user has open tickets with their ticket ID? Or show me the tickets in a custom view that can get me the ticket ID?  I've found some info about views and tickets but not going so far as to let me inspect an individual ticket that way without already knowing the ticket ID ahead of time.

I was thinking I could then either update the ticket that it was ran a second time (if possible) or at least alert the agent that a second ticket was NOT created because the first is still open and provide the number.

As a novice shell script writer I am 100% open to the idea it's all right there and I'm just overlooking something simple. I’m even hoping for it.

icon

Best answer by Kathryn Carter 10 May 2023, 20:26

View original

2 replies

Userlevel 5
Badge +2

@bclark - I’m not very familiar with all the ticket API endpoints as I’ve mostly been using the Asset endpoints.  It would be nice to have a similar endpoint like this but for agents GET/users/my/students/with/tickets

For your scenario have you looked at the /tickets/get-similar-tickets and maybe filter by OwnerID of the ticket.  Not sure if that will work but might be something to look at.  The only other option would be to write back the ticketID each time your script runs.

Userlevel 7
Badge +12

@bclark our API expert @bnelson_iiQ has reported that we do not have an API call for that. 

You are welcome to submit this to our Idea Exchange 😄

Reply