Does rt-crontool respect SLA's Business Hours?


I would like to use SLA’s in a queue, but not necessarily in the generic sense where an agent is held accountable to respond to a customer in a timely manner. This is an internal queue and there is no correspondence with any external parties. The idea is to hold the responsible agent (owner) accountable with ensuring the ticket progresses according to the designed workflow in a timely fashion.

For example, if an owner doesn’t move the ticket to the next status within a certain time frame, the ticket gets reassigned to a new owner to ensure follow up on it. rtcrontool is the perfect way to perform these automated actions, however I want them to be done according to SLA Business Hours so that the ticket owners are held accountable within reason of the company’s business hours.

Running rtcrontool only during business hours doesn’t solve the issue. Say an owner has a full business day (8 hours) to change that status of a “new” ticket to “open” otherwise it is reassigned. Say the ticket comes in at 15:00 on Friday and the company Business Hours are M-F 9:00-18:00. Even if rt-crontool doesn’t run on the weekends, rt-crontool will run again at 9:00 on Monday and determine it has been over 24 hours and reassign the ticket, which is no good. I want rtcrontool to respect the SLA Business Hours and determine that only 3 business hours have passed between Friday 15:00 and Monday 9:00; the ticket would be reassigned after 8 business hours have passed, which would be Monday 15:00.

I can’t find any documentation indicating that rt-crontool has native support to respect SLA’s. I’m guessing custom conditions may need to be written for this, but that is always challenging for me. Not to say I won’t try.

Can anyone provide any suggestions or tips?

Thanks in Advance!


Does no one else have the need to automate tasks with rt-crontool according to business hours? Maybe there’s an obvious solution here that I’m missing. Can anyone help to point me in the right direction?



If you’re using SLA’s for starts/due dates then I would think you could have rt-crontool perform searches based on those values and then perform some action on any tickets found from that search.


Hi Craig,

Good thought. However, I think the start/due dates are manipulated only by correspondence in the ticket, whereas my workflow is based on the ticket progressing through the different statuses of the lifecycle, and not related to correspondence at all.

Perhaps I could have custom scrips to update the Due date field based on the actions taken in the ticket. I would need to reference the SLA logic in order to make sure the scrips are setting the Due date based on Business Hours. Can you help me understand what my scrips would need to reference in order to use the SLA logic? This way rt-crontool doesn’t need to include logic to work around business hours; I like that concept.

Thank you!


I am not 100% on this as I haven’t tested anything, but you could try making a new scrip that runs on status change:

Condition: On Status Change
Action: Set the Due date accordingly to SLA
Template: Blank


This a good start. The only downside is each part of the lifecycle has a differing SLA. One status may be 1 business day, another status may be 3 business days, etc. Perhaps this calls for a custom Scrip Action to define some logic for this. Thoughts?



You will need some custom solution, maybe a new action as you suggested. If you look at the existing action lib/RT/Action/ you can see how it determines what the due date should be set as based off of the ‘level’ of SLA.

You would need something very similar but it would be based off of the status of the ticket instead of the SLA level. You could use a config hash like SLA uses, and call it inside your action.


Thank you Craig. I’ll take a look at the code and see what I can do with it!


I’d love to hear if you had any progress with this, I’ve a similar issue I’m hoping to address Search based on BusinessDays