Action::EscalatePriority messing up my ticket history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL –
search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)” –
action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket
history. I have tickets starting with a priority of 0 and ending with
100 in some weeks time and every night I get a new entry saying that
the ticket priority has changed. These entry are informative if the
priority has been manually changed but not if they just trace the
linear priority escalation done by a cronjob. So after a couple of
weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google
or in any wiki.

best regards,
Bernd

Dear Alex, Dear List,
thanks for your quick response. I should add that I’m using RT-3.8.1
on FreeBSD6.3/amd64 (which I forgot in my first mail).

I did the following (which didn’t quite help me):

mkdir -p Callbacks/MyCallbacks/Ticket/Elements/ShowHistory in my /local/html/Ticket directory. The whole directory "Callbacks"
hadn’t existed beforehand.
Into the file “SkipTransaction” I dumped the following:

<%init>
$$skip = 1 if (($_SkipSystemMessages) && ($Transaction->Creator eq
1));
</%init>
<%args>
$Transaction => undef
$skip => undef
$_SkipSystemMessages => undef
</%args>

Then in my “Display.html” I changed this block

<& /Ticket/Elements/ShowHistory ,
Ticket => $TicketObj,
Tickets => $Tickets,
Collapsed => $ARGS{‘Collapsed’},
ShowHeaders => $ARGS{‘ShowHeaders’},
Attachments => $attachments,
AttachmentContent => $attachment_content,
_SkipSystemMessages => !0 <----- that’s what I added
&>

I must confess I don’t have a clue what this code is doing I’m not a
programmer. The only thing I know: my ticket history is still being
messed up with priority-change entries.

I’m wondering if I could fix my problem by simply denying any existing
rights for the user doing the cron job. Of course the Right
"ModifyTicket" is needed but maybe there’s some right for tracing
changes in the history ?

best regards,
BerndOn 9 Oct 2008, at 11:29, Alex Young wrote:

I set RT to hide some of the history using this:
http://wiki.bestpractical.com/view/HideTransactions

All I have done is set it to hide the history of the RT_System user
and
the user I have setup to escalate the tickets. You can still see their
entries on the history page, just not in anoy of the other pages.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bernd
Kuhlen -WetterOnline-
Sent: 09 October 2008 10:21
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Action::EscalatePriority messing up my ticket
history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL –
search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)” –
action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket
history. I have tickets starting with a priority of 0 and ending with
100 in some weeks time and every night I get a new entry saying that
the ticket priority has changed. These entry are informative if the
priority has been manually changed but not if they just trace the
linear priority escalation done by a cronjob. So after a couple of
weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google
or in any wiki.

best regards,
Bernd


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Mit freundlichen Grüßen
Best Regards

Bernd Kuhlen
Diplom-Meteorologe
Diplom-Informatiker (FH)
Leitung Systemadministration

WetterOnline
Meteorologische Dienstleistungen GmbH
Am Rheindorfer Ufer 2
D-53117 Bonn
Amtsgericht Bonn | HRB Nummer 008664
Geschäftsführer: Dr. Joachim Klaßen
Fon: +49 (0) 228 55937-73
Fax: +49 (0) 228 55937-80
Mobil: +49 (0) 177 8214319
E-Mail: bernd.kuhlen@wetteronline.de
Web: http://www.wetteronline-gmbh.de

Hi Bernd,
not sure for EscalatePriority Module, but for the RT::Action::LinearEscalate you can define to not mess um the history:

–from the modul:

   You should prefix options with "LinearEscalate_" in the config:

       Set( $LinearEscalate_RecordTransaction, 1 );
       Set( $LinearEscalate_UpdateLastUpdated, 1 );

   From a shell you can use the following command:

       rt-crontool --search RT::Search::FromSQL --search-arg \
       "(Status='new' OR Status='open' OR Status = 'stalled')" \
       --action RT::Action::LinearEscalate \
       --action-arg "RecordTransaction: 1"

If i understand this correct, then set both to 0 will disable this. I think this module is doing more or less the same, but in a linear way.

Torsten

Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Uwe Bielang (Stellv.), Bruno Mang, Dirk Blesius (Stellv.), Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/Luxemburg Geschäftsführender Verwaltungsrat: Klaus-Michael Kühne-----Ursprüngliche Nachricht-----
Von: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] Im Auftrag von Bernd Kuhlen -WetterOnline-
Gesendet: Donnerstag, 9. Oktober 2008 11:21
An: rt-users@lists.bestpractical.com
Betreff: [rt-users] Action::EscalatePriority messing up my ticket history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL – search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)” – action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket history. I have tickets starting with a priority of 0 and ending with 100 in some weeks time and every night I get a new entry saying that the ticket priority has changed. These entry are informative if the priority has been manually changed but not if they just trace the linear priority escalation done by a cronjob. So after a couple of weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google or in any wiki.

best regards,
Bernd

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Hi,
that doesn’t to the trick either I have to stick with EscalatePriority
(for various reasons which are beyond the scope of this thread) an
there these options are not available.
In fact I cannot find any Option there that gives me a hint it might
help me out.

best regards,
BerndOn 9 Oct 2008, at 12:38, Ham MI-ID, Torsten Brumm wrote:

Hi Bernd,
not sure for EscalatePriority Module, but for the
RT::Action::LinearEscalate you can define to not mess um the history:

–from the modul:

  You should prefix options with "LinearEscalate_" in the config:

      Set( $LinearEscalate_RecordTransaction, 1 );
      Set( $LinearEscalate_UpdateLastUpdated, 1 );

  From a shell you can use the following command:

      rt-crontool --search RT::Search::FromSQL --search-arg \
      "(Status='new' OR Status='open' OR Status = 'stalled')" \
      --action RT::Action::LinearEscalate \
      --action-arg "RecordTransaction: 1"

If i understand this correct, then set both to 0 will disable this.
I think this module is doing more or less the same, but in a linear
way.

Torsten

Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann
(Vors.), Uwe Bielang (Stellv.), Bruno Mang, Dirk Blesius (Stellv.),
Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt
(Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen,
Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878,
Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/
Luxemburg Geschäftsführender Verwaltungsrat: Klaus-Michael Kühne

-----Ursprüngliche Nachricht-----
Von: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com
] Im Auftrag von Bernd Kuhlen -WetterOnline-
Gesendet: Donnerstag, 9. Oktober 2008 11:21
An: rt-users@lists.bestpractical.com
Betreff: [rt-users] Action::EscalatePriority messing up my ticket
history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL –
search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)”
– action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket
history. I have tickets starting with a priority of 0 and ending
with 100 in some weeks time and every night I get a new entry saying
that the ticket priority has changed. These entry are informative if
the priority has been manually changed but not if they just trace
the linear priority escalation done by a cronjob. So after a couple
of weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google
or in any wiki.

best regards,
Bernd


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Mit freundlichen Grüßen
Best Regards

Bernd Kuhlen
Diplom-Meteorologe
Diplom-Informatiker (FH)
Leitung Systemadministration

WetterOnline
Meteorologische Dienstleistungen GmbH
Am Rheindorfer Ufer 2
D-53117 Bonn
Amtsgericht Bonn | HRB Nummer 008664
Geschäftsführer: Dr. Joachim Klaßen
Fon: +49 (0) 228 55937-73
Fax: +49 (0) 228 55937-80
Mobil: +49 (0) 177 8214319
E-Mail: bernd.kuhlen@wetteronline.de
Web: http://www.wetteronline-gmbh.de

Hi Alex,
I think I know the core of my problem. The whole directory ./Callbacks/
MyCallbacks… hasn’t existed before so I just made a “mkdir” to have
it in my directory-tree.
But the RT doesn’t know about the existence of this directory (it’s
not configured anywhere). That’s why it’s not working out, I guess.

I have a file called “ShowHistory” in my >rt-root>/html/Ticket/
Elements/ShowHistory. I’m pretty sure somewhere within this file I
have to do the changes
I dump it for you (in case you have the time, please feel free just to
skip this mail if you’re busy …)

<%perl>
if ($ShowDisplayModes or $ShowTitle) {
my $title = $ShowTitle
? loc(‘History’)
: ’ ';

 my $titleright;

 if ($ShowDisplayModes) {
     $titleright = '';

     if ($ShowHeaders) {
         $titleright .= qq{<a href="$URIFile?id=} .
                        $Ticket->id.qq{">} .
                        loc("Brief headers") .
                        qq{</a> &mdash; };
         $titleright .= q[<span class="selected">] . loc("Full  

headers") . “”;
}
else {
$titleright .= q[] . loc(“Brief
headers”) . "
— ";
$titleright .= qq{} .
loc(“Full headers”) .
qq{
};
}
}
</%perl>

<& /Widgets/TitleBoxStart, title => $title, titleright_raw => $titleright &> % }
<%perl> my @attachments = @{$Attachments->ItemsArrayRef()}; my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};

while ( my $Transaction = $Transactions->Next ) {
my $skip = 0;
$m->callback(
%ARGS,
Transaction => $Transaction,
skip => $skip,
CallbackName => ‘SkipTransaction’,
);
next if $skip;

 $i++;

 my @trans_attachments = grep { $_->TransactionId == $Transaction- 

Id } @attachments;

 my $trans_content = {};
 grep { ($_->TransactionId == $Transaction->Id ) &&  

($trans_content->{$->Id} = $) } @attachment_content;

 my $IsLastTransaction = 0;
 if ( $OldestFirst ) {
     $IsLastTransaction = $Transactions->IsLast;
 } else {
     $IsLastTransaction = 1 if ( $i == 1 );
 }
 #Args is first because we're clobbering the "Attachments" parameter
 $m->comp( 'ShowTransaction',
         %ARGS,

           Ticket               => $Ticket,
           Transaction          => $Transaction,
           ShowHeaders          => $ShowHeaders,
           RowNum               => $i,
           Attachments          => \@trans_attachments,
           AttachmentContent    => $trans_content,
           LastTransaction      => $IsLastTransaction

);

manually flush the content buffer after each txn, so the user sees

some update

$m->flush_buffer();
}

</%perl>

% if ($ShowDisplayModes or $ShowTitle) { <& /Widgets/TitleBoxEnd &> % }
<%INIT> my $Transactions = new RT::Transactions($session{'CurrentUser'}); if ($Tickets) { while (my $t = $Tickets->Next) { $Transactions->LimitToTicket($t->id); } } else { $Transactions = $Ticket->Transactions; }

my $OldestFirst = RT->Config->Get( ‘OldestTransactionsFirst’,
$session{‘CurrentUser’} );
my $SortOrder = $OldestFirst? ‘ASC’: ‘DESC’;
$Transactions->OrderByCols( { FIELD => ‘Created’,
ORDER => $SortOrder },
{ FIELD => ‘id’,
ORDER => $SortOrder },
);

my $i;
$Attachments ||= $m->comp(’/Ticket/Elements/FindAttachments’, Ticket
=> $Ticket, Tickets => $Tickets || undef);
$AttachmentContent ||= $m->comp(’/Ticket/Elements/
LoadTextAttachments’, Ticket => $Ticket);

</%INIT>
<%ARGS>
$URIFile => RT->Config->Get(‘WebPath’)."/Ticket/Display.html"
$Ticket => undef
$Tickets => undef
$Attachments => undef
$AttachmentContent => undef
$ShowHeaders => undef
$ShowTitle => 1
$ShowDisplayModes => 1
$WarnUnsigned => undef
</%ARGS>On 9 Oct 2008, at 14:43, Bernd Kuhlen -WetterOnline- wrote:

thanks a lot.
I’ll check this out.

On 9 Oct 2008, at 14:39, Alex Young wrote:

Here is a copy of my file
/opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Elements/
ShowHistory/SkipTransaction

<%init>
$$skip = 1 if (($_SkipSystemMessages) && ($Transaction->Creator
eq 1 | $Transaction->Creator eq 12));
</%init>
<%args>
$Transaction => undef
$skip => undef
$_SkipSystemMessages => undef
</%args>

Creator ID 1 is RT_System, which pops up when you send emails out
and other systems.
Creator ID 12 is the linux/RT user which runs the escelate job.

All it is doing is seeing who created the transaction, and if its
user number 1 or 12, it skips it.

You will need ot find out the user ID number for the user running
the escelate job. You can od this by looking in the user list. The
nuber to the left is the number you would want to put into the
“Creator eq XX” bit of the code.

From: Bernd Kuhlen -WetterOnline- [mailto:bernd.kuhlen@wetteronline.de
]
Sent: 09 October 2008 11:38
To: Alex Young; rt-users@lists.bestpractical.com
Cc: Bernd Kuhlen -WetterOnline-
Subject: Re: [rt-users] Action::EscalatePriority messing up my
ticket history

Dear Alex, Dear List,
thanks for your quick response. I should add that I’m using
RT-3.8.1 on FreeBSD6.3/amd64 (which I forgot in my first mail).

I did the following (which didn’t quite help me):

mkdir -p Callbacks/MyCallbacks/Ticket/Elements/ShowHistory in my
/local/html/Ticket directory. The whole directory
"Callbacks" hadn’t existed beforehand.
Into the file “SkipTransaction” I dumped the following:

<%init>
$$skip = 1 if (($_SkipSystemMessages) && ($Transaction->Creator
eq 1));
</%init>
<%args>
$Transaction => undef
$skip => undef
$_SkipSystemMessages => undef
</%args>

Then in my “Display.html” I changed this block

<& /Ticket/Elements/ShowHistory ,
Ticket => $TicketObj,
Tickets => $Tickets,
Collapsed => $ARGS{‘Collapsed’},
ShowHeaders => $ARGS{‘ShowHeaders’},
Attachments => $attachments,
AttachmentContent => $attachment_content,
_SkipSystemMessages => !0 <----- that’s what I added
&>

I must confess I don’t have a clue what this code is doing I’m not
a programmer. The only thing I know: my ticket history is still
being messed up with priority-change entries.

I’m wondering if I could fix my problem by simply denying any
existing rights for the user doing the cron job. Of course the
Right “ModifyTicket” is needed but maybe there’s some right for
tracing changes in the history ?

best regards,
Bernd

On 9 Oct 2008, at 11:29, Alex Young wrote:

I set RT to hide some of the history using this:
http://wiki.bestpractical.com/view/HideTransactions

All I have done is set it to hide the history of the RT_System user
and
the user I have setup to escalate the tickets. You can still see
their
entries on the history page, just not in anoy of the other pages.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bernd
Kuhlen -WetterOnline-
Sent: 09 October 2008 10:21
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Action::EscalatePriority messing up my ticket
history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL –
search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)” –
action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket
history. I have tickets starting with a priority of 0 and ending with
100 in some weeks time and every night I get a new entry saying that
the ticket priority has changed. These entry are informative if the
priority has been manually changed but not if they just trace the
linear priority escalation done by a cronjob. So after a couple of
weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google
or in any wiki.

best regards,
Bernd


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

All I ever do is mkdir each directly that is needed by a script. I never
edit anything into the /opt/rt3/share/… folder. I always copy the
files I want to edit from there to /opt/rt3/local/…

Check out Using the ‘local’ directory here:
http://wiki.bestpractical.com/view/CleanlyCustomizeRT

[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bernd
Kuhlen -WetterOnline-Sent: 09 October 2008 14:10
To: Bernd Kuhlen -WetterOnline-; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Action::EscalatePriority messing up my ticket
history

Hi Alex,

I think I know the core of my problem. The whole directory
./Callbacks/MyCallbacks… hasn’t existed before so I just made a
"mkdir" to have it in my directory-tree.

But the RT doesn’t know about the existence of this directory (it’s not
configured anywhere). That’s why it’s not working out, I guess.

I have a file called “ShowHistory” in my

rt-root>/html/Ticket/Elements/ShowHistory. I’m pretty sure somewhere
within this file I have to do the changes

I dump it for you (in case you have the time, please feel free just to
skip this mail if you’re busy …)

<%perl>

if ($ShowDisplayModes or $ShowTitle) {

my $title = $ShowTitle

                ? loc('History')

                : '&nbsp;';



my $titleright;



if ($ShowDisplayModes) {

    $titleright = '';

    

    if ($ShowHeaders) {

        $titleright .= qq{<a href="$URIFile?id=} .

                       $Ticket->id.qq{">} .

                       loc("Brief headers") .  

                       qq{</a> &mdash; };

        $titleright .= q[<span class="selected">] . loc("Full

headers") . “”;

    }

    else {

        $titleright .= q[<span class="selected">] . loc("Brief

headers") . " — ";

        $titleright .= qq{<a href="$URIFile?ShowHeaders=1;id=} .

                       $Ticket->id.qq{">} .

                       loc("Full headers") .

                       qq{</a>};

    }

}

</%perl>

<& /Widgets/TitleBoxStart, title => $title, titleright_raw =>
$titleright &>

% }

<%perl>

my @attachments = @{$Attachments->ItemsArrayRef()};

my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};

while ( my $Transaction = $Transactions->Next ) {

my $skip = 0;

$m->callback(

    %ARGS,   

    Transaction   => $Transaction,

    skip          => \$skip,

    CallbackName  => 'SkipTransaction',

);

next if $skip;



$i++;



my @trans_attachments = grep { $_->TransactionId == $Transaction->Id

} @attachments;

my $trans_content = {};

grep { ($_->TransactionId == $Transaction->Id ) &&

($trans_content->{$->Id} = $) } @attachment_content;

my $IsLastTransaction = 0;

if ( $OldestFirst ) {

    $IsLastTransaction = $Transactions->IsLast;

} else {

    $IsLastTransaction = 1 if ( $i == 1 );

}

#Args is first because we're clobbering the "Attachments" parameter

$m->comp( 'ShowTransaction',

        %ARGS,



          Ticket               => $Ticket,

          Transaction          => $Transaction,

          ShowHeaders          => $ShowHeaders,

          RowNum               => $i,

          Attachments          => \@trans_attachments,

          AttachmentContent    => $trans_content,

          LastTransaction      => $IsLastTransaction

);

manually flush the content buffer after each txn, so the user sees

some update

$m->flush_buffer();

}

</%perl>

% if ($ShowDisplayModes or $ShowTitle) {

<& /Widgets/TitleBoxEnd &>

% }

<%INIT>

my $Transactions = new RT::Transactions($session{‘CurrentUser’});

if ($Tickets) {

while (my $t = $Tickets->Next) {

    $Transactions->LimitToTicket($t->id);

}

} else {

$Transactions = $Ticket->Transactions;

}

my $OldestFirst = RT->Config->Get( ‘OldestTransactionsFirst’,
$session{‘CurrentUser’} );

my $SortOrder = $OldestFirst? ‘ASC’: ‘DESC’;

$Transactions->OrderByCols( { FIELD => ‘Created’,

                          ORDER => $SortOrder },

                        { FIELD => 'id',

                          ORDER => $SortOrder },

                      );

my $i;

$Attachments ||= $m->comp(’/Ticket/Elements/FindAttachments’, Ticket =>
$Ticket, Tickets => $Tickets || undef);

$AttachmentContent ||= $m->comp(’/Ticket/Elements/LoadTextAttachments’,
Ticket => $Ticket);

</%INIT>

<%ARGS>

$URIFile => RT->Config->Get(‘WebPath’)."/Ticket/Display.html"

$Ticket => undef

$Tickets => undef

$Attachments => undef

$AttachmentContent => undef

$ShowHeaders => undef

$ShowTitle => 1

$ShowDisplayModes => 1

$WarnUnsigned => undef

</%ARGS>

Thanks a lot, I think I finally got to the point. I was mistaken about
the right directory path. I accidentally installied my mycallback-
dirtree in the -directory rather than /local …
that’s all.
best regards,
BerndOn 9 Oct 2008, at 15:15, Alex Young wrote:

All I ever do is mkdir each directly that is needed by a script. I
never edit anything into the /opt/rt3/share/… folder. I always
copy the files I want to edit from there to /opt/rt3/local/…

Check out Using the ‘local’ directory here: http://wiki.bestpractical.com/view/CleanlyCustomizeRT

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com
] On Behalf Of Bernd Kuhlen -WetterOnline-
Sent: 09 October 2008 14:10
To: Bernd Kuhlen -WetterOnline-; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Action::EscalatePriority messing up my
ticket history

Hi Alex,
I think I know the core of my problem. The whole directory ./
Callbacks/MyCallbacks… hasn’t existed before so I just made a
"mkdir" to have it in my directory-tree.
But the RT doesn’t know about the existence of this directory (it’s
not configured anywhere). That’s why it’s not working out, I guess.

I have a file called “ShowHistory” in my >rt-root>/html/Ticket/
Elements/ShowHistory. I’m pretty sure somewhere within this file I
have to do the changes
I dump it for you (in case you have the time, please feel free just
to skip this mail if you’re busy …)

<%perl>
if ($ShowDisplayModes or $ShowTitle) {
my $title = $ShowTitle
? loc(‘History’)
: ’ ';

my $titleright;

if ($ShowDisplayModes) {
    $titleright = '';

    if ($ShowHeaders) {
        $titleright .= qq{<a href="$URIFile?id=} .
                       $Ticket->id.qq{">} .
                       loc("Brief headers") .
                       qq{</a> &mdash; };
        $titleright .= q[<span class="selected">] . loc("Full  

headers") . “”;
}
else {
$titleright .= q[] . loc(“Brief
headers”) . "
— ";
$titleright .= qq{} .
loc(“Full headers”) .
qq{
};
}
}
</%perl>

<& /Widgets/TitleBoxStart, title => $title, titleright_raw => $titleright &> % }
<%perl> my @attachments = @{$Attachments->ItemsArrayRef()}; my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};

while ( my $Transaction = $Transactions->Next ) {
my $skip = 0;
$m->callback(
%ARGS,
Transaction => $Transaction,
skip => $skip,
CallbackName => ‘SkipTransaction’,
);
next if $skip;

$i++;

my @trans_attachments = grep { $_->TransactionId == $Transaction- 

Id } @attachments;

my $trans_content = {};
grep { ($_->TransactionId == $Transaction->Id ) &&  

($trans_content->{$->Id} = $) } @attachment_content;

my $IsLastTransaction = 0;
if ( $OldestFirst ) {
    $IsLastTransaction = $Transactions->IsLast;
} else {
    $IsLastTransaction = 1 if ( $i == 1 );
}
#Args is first because we're clobbering the "Attachments"  

parameter
$m->comp( ‘ShowTransaction’,
%ARGS,

          Ticket               => $Ticket,
          Transaction          => $Transaction,
          ShowHeaders          => $ShowHeaders,
          RowNum               => $i,
          Attachments          => \@trans_attachments,
          AttachmentContent    => $trans_content,
          LastTransaction      => $IsLastTransaction

);

manually flush the content buffer after each txn, so the user sees

some update

$m->flush_buffer();
}

</%perl>

% if ($ShowDisplayModes or $ShowTitle) { <& /Widgets/TitleBoxEnd &> % }
<%INIT> my $Transactions = new RT::Transactions($session{'CurrentUser'}); if ($Tickets) { while (my $t = $Tickets->Next) { $Transactions->LimitToTicket($t->id); } } else { $Transactions = $Ticket->Transactions; }

my $OldestFirst = RT->Config->Get( ‘OldestTransactionsFirst’,
$session{‘CurrentUser’} );
my $SortOrder = $OldestFirst? ‘ASC’: ‘DESC’;
$Transactions->OrderByCols( { FIELD => ‘Created’,
ORDER => $SortOrder },
{ FIELD => ‘id’,
ORDER => $SortOrder },
);

my $i;
$Attachments ||= $m->comp(’/Ticket/Elements/FindAttachments’,
Ticket => $Ticket, Tickets => $Tickets || undef);
$AttachmentContent ||= $m->comp(’/Ticket/Elements/
LoadTextAttachments’, Ticket => $Ticket);

</%INIT>
<%ARGS>
$URIFile => RT->Config->Get(‘WebPath’)."/Ticket/Display.html"
$Ticket => undef
$Tickets => undef
$Attachments => undef
$AttachmentContent => undef
$ShowHeaders => undef
$ShowTitle => 1
$ShowDisplayModes => 1
$WarnUnsigned => undef
</%ARGS>

On 9 Oct 2008, at 14:43, Bernd Kuhlen -WetterOnline- wrote:

thanks a lot.
I’ll check this out.

On 9 Oct 2008, at 14:39, Alex Young wrote:

Here is a copy of my file
/opt/rt3/local/html/Callbacks/MyCallbacks/Ticket/Elements/
ShowHistory/SkipTransaction

<%init>
$$skip = 1 if (($_SkipSystemMessages) && ($Transaction->Creator eq
1 | $Transaction->Creator eq 12));
</%init>
<%args>
$Transaction => undef
$skip => undef
$_SkipSystemMessages => undef
</%args>

Creator ID 1 is RT_System, which pops up when you send emails out
and other systems.
Creator ID 12 is the linux/RT user which runs the escelate job.

All it is doing is seeing who created the transaction, and if its
user number 1 or 12, it skips it.

You will need ot find out the user ID number for the user running
the escelate job. You can od this by looking in the user list. The
nuber to the left is the number you would want to put into the
“Creator eq XX” bit of the code.

From: Bernd Kuhlen -WetterOnline-
[mailto:bernd.kuhlen@wetteronline.de]
Sent: 09 October 2008 11:38
To: Alex Young; rt-users@lists.bestpractical.com
Cc: Bernd Kuhlen -WetterOnline-
Subject: Re: [rt-users] Action::EscalatePriority messing up my
ticket history

Dear Alex, Dear List,
thanks for your quick response. I should add that I’m using RT-3.8.1
on FreeBSD6.3/amd64 (which I forgot in my first mail).

I did the following (which didn’t quite help me):

mkdir -p Callbacks/MyCallbacks/Ticket/Elements/ShowHistory in my /local/html/Ticket directory. The whole directory "Callbacks"
hadn’t existed beforehand.
Into the file “SkipTransaction” I dumped the following:

<%init>
$$skip = 1 if (($_SkipSystemMessages) && ($Transaction->Creator eq
1));
</%init>
<%args>
$Transaction => undef
$skip => undef
$_SkipSystemMessages => undef
</%args>

Then in my “Display.html” I changed this block

<& /Ticket/Elements/ShowHistory ,
Ticket => $TicketObj,
Tickets => $Tickets,
Collapsed => $ARGS{‘Collapsed’},
ShowHeaders => $ARGS{‘ShowHeaders’},
Attachments => $attachments,
AttachmentContent => $attachment_content,
_SkipSystemMessages => !0 <----- that’s what I added
&>

I must confess I don’t have a clue what this code is doing I’m not a
programmer. The only thing I know: my ticket history is still being
messed up with priority-change entries.

I’m wondering if I could fix my problem by simply denying any
existing rights for the user doing the cron job. Of course the Right
"ModifyTicket" is needed but maybe there’s some right for tracing
changes in the history ?

best regards,
Bernd

On 9 Oct 2008, at 11:29, Alex Young wrote:

I set RT to hide some of the history using this:
http://wiki.bestpractical.com/view/HideTransactions

All I have done is set it to hide the history of the RT_System user
and
the user I have setup to escalate the tickets. You can still see their
entries on the history page, just not in anoy of the other pages.

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bernd
Kuhlen -WetterOnline-
Sent: 09 October 2008 10:21
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Action::EscalatePriority messing up my ticket
history

Hi everyone,

I’ve set up my rt-crontool like this:

0 1 * * * /usr/local/bin/rt-crontool --search RT::Search::FromSQL –
search-arg “(Status=‘new’ OR Status=‘open’ OR Status = ‘stalled’)” –
action RT::Action::EscalatePriority >/dev/null 2>/dev/null

and it’s working fine. But I don’t want it to mess up my ticket
history. I have tickets starting with a priority of 0 and ending with
100 in some weeks time and every night I get a new entry saying that
the ticket priority has changed. These entry are informative if the
priority has been manually changed but not if they just trace the
linear priority escalation done by a cronjob. So after a couple of
weeks I have numerous lines with a “ticket-priority changed” entry.
That’s not nice.

I’m new to RT and couldn’t find anything about this matter by google
or in any wiki.

best regards,
Bernd


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Mit freundlichen Grüßen
Best Regards

Bernd Kuhlen
Diplom-Meteorologe
Diplom-Informatiker (FH)
Leitung Systemadministration

WetterOnline
Meteorologische Dienstleistungen GmbH
Am Rheindorfer Ufer 2
D-53117 Bonn
Amtsgericht Bonn | HRB Nummer 008664
Geschäftsführer: Dr. Joachim Klaßen
Fon: +49 (0) 228 55937-73
Fax: +49 (0) 228 55937-80
Mobil: +49 (0) 177 8214319
E-Mail: bernd.kuhlen@wetteronline.de
Web: http://www.wetteronline-gmbh.de