Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Bulk change ticket SLA


I have about 300 tickets that need to have their SLA adjusted.  I've defined a new SLA, and now I want to apply it to all the existing tickets.

Is there an automated way I can do this?  Perhaps directly in the database, by modifying the "sla_id" of each ticket?



  • Yes, the only way to do that would be directly in the database. There is no way to do that in the UI. 
  • edited January 2017
    I decided to do this in SQL.  In case someone else needs this, here's what I did:

    update ost_ticket, ost_ticket_status 
    ost_ticket.sla_id = "2", 
    ost_ticket.est_duedate=date_add(ost_ticket.created, interval 8760 hour) 
    ost_ticket.topic_id=12 and 
    ost_ticket.status_id = and 
    ost_ticket_status.state = "open";

    This finds all tickets that are help topic ID 12 and in a status where the ticket is in an open state, and then unsets the over-due flag, changes the SLA plan to the correct SLA plan ID, and sets the due-date to the ticket created date +1 year (same as the SLA plan, 1 year before it's past-due).

  • This would be an ideal thing to have as a feature I believe. taking a certain amount of tickets or all of them and apply the SLA to it. Thank you @jdelisle for providing the details on what to do.
  • @Synt4xError -  Thanks, hope it comes in helpful to someone.  

    One thing I should mention is that the SQL above doesn't update the ticket "Request Thread" (the history of changes made to the ticket, things like "System assigned this ticket to team ABC").  Some shops might have audit requirements, or maybe infosec concerns, and might be concerned about this.  It is doable, but the SQL above would need considerable modification to add an entry along the lines of "System changed SLA from X to Y".
Sign In or Register to comment.