[rt-users] RT tool & RecordTransaction => 0

Bart bart at pleh.info
Thu Dec 8 01:34:42 EST 2011


Hmm, I might need to rethink my script then...

Have this script in cron:

#!/bin/bash

datum=`date "+%d%m%y"`
tijd=`date "+%H%M"`

if [ $tijd -ge 0830 -a $datum -ne 261211 -a $datum -ne 090412 -a $datum -ne
300412 -a $datum -ne 170512 -a $datum -ne 180512 -a $datum -ne 280512 -a
$datum -ne 251212 -a $datum -ne 261212 ]
then
for i in `/opt/rt4/bin/rt ls -t ticket "Status!='resolved' and
Status!='rejected' and Status!='spam' and Status!='deleted'" -f status |
grep ^[0-9] | cut -f 1`; do
case `/opt/rt4/bin/rt ls -t ticket "id=$i" -f status | grep ^[0-9] | cut -f
2` in
new) /opt/rt4/bin/rt edit ticket/$i set CF-'aantal_minuten_new'=$((
`/opt/rt4/bin/rt ls -t ticket "id=$i" -f CF-'aantal_minuten_new' | grep
^[0-9] | cut -f 2` + 5 ))&
;;
open) /opt/rt4/bin/rt edit ticket/$i set CF-'aantal_minuten_open'=$((
`/opt/rt4/bin/rt ls -t ticket "id=$i" -f CF-'aantal_minuten_open' | grep
^[0-9] | cut -f 2` + 5 ))&
;;
stalled) /opt/rt4/bin/rt edit ticket/$i set CF-'aantal_minuten_stalled'=$((
`/opt/rt4/bin/rt ls -t ticket "id=$i" -f CF-'aantal_minuten_stalled' | grep
^[0-9] | cut -f 2` + 5 ))&
;;
Bij_Leverancier) /opt/rt4/bin/rt edit ticket/$i set
CF-'aantal_minuten_Bij_Leverancier'=$(( `/opt/rt4/bin/rt ls -t ticket
"id=$i" -f CF-'aantal_minuten_Bij_Leverancier' | grep ^[0-9] | cut -f 2` +
5 ))&
;;
Bij_Aanvrager) /opt/rt4/bin/rt edit ticket/$i set
CF-'aantal_minuten_Bij_Aanvrager'=$(( `/opt/rt4/bin/rt ls -t ticket "id=$i"
-f CF-'aantal_minuten_Bij_Aanvrager' | grep ^[0-9] | cut -f 2` + 5 ))&
;;
Intern) /opt/rt4/bin/rt edit ticket/$i set CF-'aantal_minuten_Intern'=$((
`/opt/rt4/bin/rt ls -t ticket "id=$i" -f CF-'aantal_minuten_Intern' | grep
^[0-9] | cut -f 2` + 5 ))&
;;
*) ;;
esac
done
fi

It runs every 5 minutes during business hours, rough translation would be
that it runs 114 times a day. During each run it increases the value of a
custom field by 5, this will give us the amount of time in minutes a ticket
stood at a certain active status. (in the above you'll see a few default
statuses along with a few custom ones)

I kinda overlooked that it writes an entry in the ticket history where it
shows the change of the CF value... 114 times a day for each ticket, where
an average ticket might be open a few days (changes or problems even
longer). . .

Users however won't see these changes unless they hit the history tab, but
I the ticket view will be slowed down when the history gets bigger and
bigger (we use RT::Extension::HistoryFilter, but even with it RT will first
load the entire history)....

Any suggestions on how to achieve the above without writing stuff in the
ticket history?


-- Bart


Op 7 december 2011 22:44 schreef Ruslan Zakirov <ruz at bestpractical.com> het
volgende:

> On Wed, Dec 7, 2011 at 7:23 PM, Bart <bart at pleh.info> wrote:
> > Hi,
> >
> > Is there an equivalent way of making the transactions silent via the RT
> > tool?
>
> No.
>
> >
> > Within a normal scrip using RecordTransaction => 0, is there a similar
> way
> > for making an edit via the RT tool silent?
> >
> > -- Bart
> >
> > --------
> > RT Training Sessions (http://bestpractical.com/services/training.html)
> > * Boston — March 5 & 6, 2012
>
>
>
> --
> Best regards, Ruslan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20111208/6eaea53a/attachment.htm>


More information about the rt-users mailing list