Hmm .. the notes field tells you the date/time when a ticket change occurred .. and this includes stage changes.
But it would be quite messy to filter out the date/time in amongst all the other data
So 2 ideas
1) You could add an escalation procedure for each stage that runs a command every 5 mins as an example
So the command would run the first time , and set the variable to 5
Then it would run again 5 minutes later and then increment the variable to 10
etc until the ticket leaves the stage
You'd need a separate variable for each stage
Would you ever have a ticket leaving a stage and then later return to the same stage ?
2) There’s also a Kaseya Databse view “vbo_SDIncidents_Activities” that is a sort of history re ticket changes
If you filter the SDNote filed you can find all the entries that relate to
e.g.
SELECT TOP 1000 [PARTITIONID]
,[ID]
,[REF]
,[inc_ref]
,[SDNOTE]
,[INCIDENTEDITDATETIME]
,[HIDDENFLAG]
,[IncidentEditorFK]
FROM [ksubscribers].[kasadmin].[vbo_SDIncidents_Activities]
where SDNOTE like '%stage%was%'