I have seen this request in a few placed

Heck, the women in your "What's New in osTicket Version 1.14?" video even SAYS the word "respond" (not complete)
https://youtu.be/_rjPdgwsptY?t=46

But then the documentation says this:
Service Level Agreement (SLA) defines a Grace Period, in hours, to which a task or service must be completed before it’s marked overdue.

We desperately need the feature to allow SLAs to be correctly tracked based on first response time and not completion time (or in addition to).

It looks like it was being worked on here: https://github.com/osTicket/osTicket/pull/419
But nothing since 2016 except people asking for this.

What else can we do to get this feature pushed through? I am even willing to help code things myself (or if you had a plug in writing tutorial... )

The video you referenced is regarding the forthcoming 1.14 release.
The documentation that you referenced is for the current Stable release (1.12).
Both are correct for their intended versions.
You will have to wait until 1.14 is released to do what the video for 1.14 says.

KevinTheJedi
I was more looking at a fully fleshed out feature. I already added an extra radio button the SLA inc file so you can indicate what kind of SLA it is. Then it would be a new field in the database to store this value.

I'll take a look at the linked file as there would have to be an if statement there to make the appropriate decision. I am also assuming there are others places as well (where ever the stale tickets are kicked off from)

I know this would be way better as a module, but I'll put through a pull request ok GitHub so others can evaluate my work. I am still looking at the existing modules to see how they work and maybe create this way next.

@KevinTheJedi
So I guess one more question: what is the behavior in 1.14? Will we be able to do SLAs based on response time or is it still going to be based on close time?

5 months later

OK so I got it too late. If anyone is still using version 12 here's the full SQL

SELECT ticket_id FROM ost_ticket T1 USE INDEX (status_id)
INNER JOIN ost_ticket_status status ON (status.id=T1.status_id AND status.state="open")
LEFT JOIN ost_sla T2 ON (T1.sla_id=T2.id AND T2.flags & 1 = 1)
WHERE isoverdue=0 AND
((reopened is NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),T1.created))>=T2.grace_period3600)
OR (reopened is NOT NULL AND duedate is NULL AND TIME_TO_SEC(TIMEDIFF(NOW(),reopened))>=T2.grace_period
3600)
OR (duedate is NOT NULL AND duedate<NOW()) ) AND T1.lastupdate = T1.created ORDER BY T1.created LIMIT 50;

File: includes\class.tickets.php
Row: 4216 (or there abouts)
There are a few updates to make to the above. Take a look at the existing sql query as it uses variables for the ost_ticket table and others.

@KevinTheJedi Any clues on the new format? My simple solution was just to check to see if the T1.lastupdate = T1.created as then we know the ticket wasn't updated since the create date/time.

The new format (still trying to wrap my head around it), appears to let us assign variables to the array, but I have no idea how to make the array reference the existing data.

Still looking but any help would be appreciated (even just a nudge to a line to look at)!

EDIT: This is no good either. So when you say, is the create_date equal to the last_update date, that includes ANY updates. So if you assigned a ticket, boom! You just updated the ticket... not so good. So DONT DO THIS!!!

See my answer below for a better method on version 14. (The same kind of thing could be done for version 12)

    Or is this it?
    Edit: NO THIS IS BAD!

    static function checkOverdue() {
            $overdue = static::objects()
                ->filter(array(
                    'isoverdue' => 0,
                    'status__state' => 'open',
    				'create_date' => 'Ticket.last_update',
                    Q::any(array(
                        Q::all(array(
                            'duedate__isnull' => true,
                            'est_duedate__isnull' => false,
                            'est_duedate__lt' => SqlFunction::NOW()),
                            ),
                        Q::all(array(
                            'duedate__isnull' => false,
                            'duedate__lt' => SqlFunction::NOW())
                            )
                        ))
                    ))
                ->limit(100);
    
            foreach ($overdue as $ticket)
                $ticket->markOverdue();
    
        }

    Yes, and I figured it out!

    Here is the code change (one line!):

    File: include\class.ticket.php 
    Line: 4599
    
    static function checkOverdue() {
            $overdue = static::objects()
                ->filter(array(
                    'isoverdue' => 0,
                    'status__state' => 'open',
    				'status_id' => 1,  // THIS LINE HERE 
                    Q::any(array(
                        Q::all(array(
                            'duedate__isnull' => true,
                            'est_duedate__isnull' => false,
                            'est_duedate__lt' => SqlFunction::NOW()),
                            ),
                        Q::all(array(
                            'duedate__isnull' => false,
                            'duedate__lt' => SqlFunction::NOW())
                            )
                        ))
                    ))
                ->limit(100);
    
            foreach ($overdue as $ticket)
                $ticket->markOverdue();
    
        }

    So the logic behind this is that we now added 3 more "open" statuses (or statusstate in the code). Then when we reply we change to another status.
    Those statuses are: In Progress, Waiting for End User, Waiting on Vendor/Parts.

    The new line then says, it will only mark as over due when the status is Open (status ID 1) and the rest of the normal criteria.

    Hoping this helps someone else too!

    a month later
    5 months later

    Version 14.3 change is located at line 4652

    2 months later
    7 months later

    Keegan_csd Hi, do you still have a copy of the SQL for this? I believe the forums formatting has changed your message (I assume asterix?) and I don't know enough SQL to understand where the missing characters are!

    If you do get this message, would you be able to use the insert code option in the editor? I would be really grateful!

    Cheers.

    Edit: Disregard, I figured it out to be asterix on the grace_period. However MariaDB doesn't like 'ORDER BY T1.created LIMIT 50;' so I'll likely be waiting until whenever v2 drops for that github PR you mentioned

    Write a Reply...