Time delay in the queue

Hi all,

I have been playing with RT and am very happy with its feature set. I wish
to deploy it in a multiple sysadmin scenario.

Here is what I want to do now:

If an email/ticket has been in a queue for greater than a specified amount
of time and no one takes responsibility for it, then it (or a note about it)
gets mailed to a “big boss” email address, i.e. gets escalated.

I would be happy to get some hand holding on this.

Thanks for your time,
-ansh

Hi all,

I have been playing with RT and am very happy with its feature set. I wish
to deploy it in a multiple sysadmin scenario.

I’m using it in a similar fashion.

If an email/ticket has been in a queue for greater than a specified amount
of time and no one takes responsibility for it, then it (or a note about it)
gets mailed to a “big boss” email address, i.e. gets escalated.

I would be happy to get some hand holding on this.

Ok, without the no one takes responsiblity part, it’s pretty easy; use the
escalator script, combined with the IfPriorityExceeds scrip.

Both live in http://fsck.com/pub/rt/contrib/2.0/rt-addons/

Adding the “no one takes responsibiliity” depends on your setup: Do you
mean it’s still new, it’s still owned by Nobody, or nobody has taken
action on it, or what?

I suspect a simple change to the IfPriority script or in the template
called would do the job though. I’d probably (and will) write a template
that will either complain to me and/or to the ticket’s owner’s that it’s
still undone.

Another way to do this would be to write a script that looks at how old a
ticket is, and work from that too… but why not take advantage of the
priorities at the same time? That way, different time periods and
emergencies can be handled too. If it’s important, just make it higher
priority, and it will have to be dealt with sooner.

Thanks for the reply Seth.

From what I could gather this runs a nightly check and increments the
priorities. Right ? I am looking for something that escalates in the order
of 15-20 minutes. Maybe I should roll my own …

It exists:

http://www.fsck.com/pub/rt/contrib/2.0/sql_rt2_escalator.README
and
http://www.fsck.com/pub/rt/contrib/2.0/sql_rt2_escalator.pl

It won’t trigger the IfPriorityExceed scripts though (sadly)
because it’s bypassing RT and doing it directly in the database.
Can anyone suggest a fix for this?

This can runs as often as you like (every 15-20) minutes…

If you really just want a “every 15-20 minutes, look for tickets that
nobody’s touched and complain about them”, I’d just use a cron job, with a
simple RT query and if any exist, email whomever.

Seth Cohn, General Manager of Eugene Free Community Network gm@efn.org

Businesses planned for service are apt to succeed; Phone 541-484-9637

Businesses planned for profit are apt to fail. - N. Butler

[Apologies if this gets double posted. My fingers had a moment of their
own before I was able to finish my message :-)]On Fri, Jan 17, 2003 at 03:23:21PM -0800, Anshuman Kanwar wrote:

Thanks for the reply Seth.

From what I could gather this runs a nightly check and increments the
priorities. Right ? I am looking for something that escalates in the order
of 15-20 minutes. Maybe I should roll my own …

I built an escalator meant to run every five minutes from cron for monitoring
tickets coming into our crisis queue.

We have a site policy of responding to these tickets within fifteen minutes,
otherwise it starts adding people on as watchers (which happen to be our
email addresses for our pagers). Every fifteen minutes, if no one has done
something with the ticket, another person (or level of management) gets
tacked on, priority gets bumped, and all watchers are notified. This
continues until someone moves it out of the queue or resolves it.

This queue is specifically configured so that priority starts at 1 and goes
to 99 in one day (because the escalator runs so often).

The queue is also setup to NotifyAdminCc’s on Correspondance and on Comment
so we don’t have to build any sort of notifications into the script; RT does
it for us. We use a template that only sends a minimal amount of info (queue
and ticket number) because it’s being sent to an alphanumeric pager with a
limited character count for incoming messages.

The only caveat with we found is that if you do this for a specific queue,
and have another escalator that does a daily priority bump for all your
queues, you need to make sure both escalations don’t collide. We got around
this by doing something like

    $tickets->LimitQueue(VALUE => 'MyQueue', OPERATOR => '!=');                                                               

in our daily escalator.

I’ve attached it. YMMV.

(I hope this makes sense. I’m being bombarded by the kids while I write
this :sunglasses:

Travis
Travis Campbell - Unix Systems Administrator = travis@mpdtxmail.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@mpdtxmail.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.

crisis-escalator (5.91 KB)

The queue is also setup to NotifyAdminCc’s on Correspondance and on Comment

That should have been OnCreate and OnComment.

Travis
Travis Campbell - Unix Systems Administrator = travis@mpdtxmail.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@mpdtxmail.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.

If all you want to do is email your boss if the ticket is unowned you
could probably do something like this:

$Header:

/raid/cvsroot/rt-addons/ScripActions/EscalatePriority/EscalatePriority.pm,v 1.2 2001/06/22 23:50:37 jesse
Exp $

package RT::Action::EscalatePriority;
require RT::Action::Generic;
@ISA=qw(RT::Action::Generic);

#Do what we need to do and send it out.

#What does this type of Action does

{{{ sub Describe

sub Describe {
my $self = shift;
return (ref $self . " will escalate a ticket by emailing a big
boss.");
}

}}}

{{{ sub Prepare

sub Prepare {
my $self = shift;

if ($self->TicketObj->Owner = “Nobody”) {

INSERT YOUR MAIL CODE HERE?? or maybe you use a scrip condition to do

it for you.

##probably RT already has a slick way to do this
##I am an RT novice and so what to do here escapes me
}
}

That does remove all the priority stuff. Then you just cron up that
script. The downside is pretty obvious. Your boss is going to get upset
if the volume gets to heavy. Probably because every 5 minutes all day
Saturday and Sunday the ticket that was created Friday at 5:00 is going
to be emailing him. (576 times over a two day period, ouch). You could
certainly fine-tune a script that would in fact check to see if people
should be at work taking ownership of tickets before you send your poor
big boss 576 emails over the weekend. Maybe you could fine tune your
cron to not work on Saturdays, Sundays and holidays?

Or… You could just set have your boss open up the search page. Set up
the queue the boss is responsible for with owner = “Nobody”. Set it to
refresh every 5 minutes.

Or… You could write a script that directly accesses the database every
5 minutes and jams a quick email if the owner is nobody (Select id from
Tickets where Owner = “Nobody”).

The search page is IMHO your best option. The only downside is that it
isn’t quite as ‘in your face’ as email. I guess bosses have slick email
clients that say “You’ve got mail” and they wouldn’t get that reminder.

Good Luck,
Ron

Message: 15
From: Anshuman Kanwar Anshuman@expertcity.com
To: “‘Seth Cohn, EFN General Manager’” gm@efn.org
Cc: rt-users@lists.fsck.com
Subject: RE: [rt-users] time delay in the queue
Date: Fri, 17 Jan 2003 15:23:21 -0800

Thanks for the reply Seth.

From what I could gather this runs a nightly check and increments the
priorities. Right ? I am looking for something that escalates in the order
of 15-20 minutes. Maybe I should roll my own …

Thansk you,
-ansh

/************************************************************