Trigger timer on status update

Hello! I am very much a beginner and I am working on creating an app that can start the timer and set the status to a certain value with one click.

I created an app that successfully starts the timer and sets the status value to the correct status with the click of a button in the ticket top navigation bar. However, the user would still need to press the update button to update the ticket status. After searching this forum I found that the ticket cannot be updated with the Interface API. I could use the Ticket Update API, but would rather not.

Instead, I was thinking that I could trigger the timer to start running after the user clicks update.

Is it possible to use the interface API to start the timer triggered by clicking the update button?

2 Likes

Hi Jess,

First of all, I would like to welcome you to the community! :tada:

Thank you for doing the research to find answers before raising a new request.

I hope, your question is to find a method to handle when the user clicks the update button so that the timer can be triggered with the Interface API after the status has been changed.

This propertiesUpdated intercept event [1] can help to get notified about any property changes including status field change and the update action is triggered. The operation can be done and the change event can be continued or stopped from the app based on the callback shown in the example.

[1] https://developer.freshdesk.com/v2/docs/events-api/#interceptticketpropertiesupdates

1 Like

@Raviraj thanks for your quick response. I will see what I can do with the intercept event. Thank you!

1 Like

Follow up to this issue - is there a way to keep the timer running when the ticket is not the active tab in Freshdesk? It seems that by default, the timer will pause when the agent opens a new tab. We would like the timer to run continuously until the agent forces the stop.

@Jess This is the default behavior.

With Interface API, it is not possible to make the timer run when the agent moves to another tab as well.

As a workaround, the app can run a timer on its own and store the time-spent in the browser localStorage. The recorded time can be added as a time-entry via Freshdesk API on a particular time interval.

Please create a topic in the “Feedback” category if you would like to request this as a feature. We can report it to the Freshdesk product team to take it up for consideration and validate the feature request.