Get last status change for a ticket

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m trying to write a(nother) nag script, and I’d like to check the last time
the status was changed. So far I have:

my $transactions = $Ticket->Transactions();
transactions->Limit(FIELD => 'Type', VALUE => 'Status');
transactions->Limit(FIELD => 'NewValue', VALUE => 'open');

What more do I need to make sure I only get one result?

  • -Doug

Douglas E. Warner dwarner@ctinetworks.com Network Engineer
CTI/PAdotNET http://www.pa.net +1 717 975 9000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8++XiJV36su0A0xIRArbdAKDjlLA9ijBh69QY1hZ6YQIlePAc/gCfTc60
JM49gxzQAW6TsP+5hRrrAv4=
=oOLM
-----END PGP SIGNATURE-----

I’m trying to write a(nother) nag script, and I’d like to check the last time
the status was changed. So far I have:

my $transactions = $Ticket->Transactions();
transactions->Limit(FIELD => 'Type', VALUE => 'Status');
transactions->Limit(FIELD => 'NewValue', VALUE => 'open');

What more do I need to make sure I only get one result?

Make sure that you also do a $transactions->SortBy (with the time).

Then, issue a $transaction = $transactions->First to get the first record.

Regards,
Timo

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Monday 03 June 2002 18:07, Timo Hummel wrote:

Make sure that you also do a $transactions->SortBy (with the time).

I found that I needed to use the ‘OrderBy’ function, not the 'SortBy’
function.

Thanks for your help though. I’m still trying to learn RT’s backend. I’ll
post the nag script once I’m done with it. Should it go here or to rt-users?

  • -Doug

Douglas E. Warner dwarner@ctinetworks.com Network Engineer
CTI/PAdotNET http://www.pa.net +1 717 975 9000
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8/Ap1JV36su0A0xIRAvb/AJ0degoFcQVtF6MeMNce064DhmNqoACfaNsW
1VoqkzXdcjZH0WighoNDkAo=
=A0cn
-----END PGP SIGNATURE-----