Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

How to get TicketObj from a Ticket ID

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


torsten.brumm at Kuehne-Nagel

Nov 17, 2009, 6:33 AM

Post #1 of 5 (385 views)
Permalink
How to get TicketObj from a Ticket ID

Hi,
i'm now searching since some hours how to get the TicketObj from a given Ticket ID.

Normally from within a scrip i go this way: $self->TicketObj and i can work with all the Information (like $self->TicketObj->Status etc)

Now i have only i Ticket ID stored in a variable and i'm searching a way to get back my TicketObj.

Any hints? I'm lost at the moment

Thanks

Torsten

Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne



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

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


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


mzagrabe at d

Nov 17, 2009, 6:38 AM

Post #2 of 5 (362 views)
Permalink
Re: How to get TicketObj from a Ticket ID [In reply to]

On Tue, 2009-11-17 at 15:33 +0100, Brumm, Torsten / Kuehne + Nagel / Ham
MI-ID wrote:
> Hi,
> i'm now searching since some hours how to get the TicketObj from a given Ticket ID.
>
> Normally from within a scrip i go this way: $self->TicketObj and i can work with all the Information (like $self->TicketObj->Status etc)
>
> Now i have only i Ticket ID stored in a variable and i'm searching a way to get back my TicketObj.

my $TicketObj = LoadTicket($id);

--
Matt Zagrabelny - mzagrabe [at] d - (218) 726 8844
University of Minnesota Duluth
Information Technology Systems & Services
PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot
lose.
-Jim Elliot

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

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


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


smithj4 at bnl

Nov 17, 2009, 6:42 AM

Post #3 of 5 (359 views)
Permalink
Re: How to get TicketObj from a Ticket ID [In reply to]

On Tue, 2009-11-17 at 15:33 +0100, Brumm, Torsten / Kuehne + Nagel / Ham
MI-ID wrote:
> Hi,
> i'm now searching since some hours how to get the TicketObj from a given Ticket ID.
>
> Normally from within a scrip i go this way: $self->TicketObj and i can work with all the Information (like $self->TicketObj->Status etc)
>
> Now i have only i Ticket ID stored in a variable and i'm searching a way to get back my TicketObj.
>
> Any hints? I'm lost at the moment

Try something like:

my $Ticket = RT::Ticket->new($RT::SystemUser);
$Ticket->Load(TicketID#)

You can replace $RT::SystemUser with an RT::CurrentUser object for a
user in your system if you want to have actions restricted by or
transactions recorded for that user.

> Thanks
>
> Torsten
>
> Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne
>
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales [at] bestpractical
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
--
/------------------------------------------------------------------\
| Jason A. Smith Email: smithj4 [at] bnl |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
\------------------------------------------------------------------/
Attachments: smime.p7s (3.81 KB)


torsten.brumm at Kuehne-Nagel

Nov 17, 2009, 7:12 AM

Post #4 of 5 (359 views)
Permalink
Re: How to get TicketObj from a Ticket ID [In reply to]

Hi Matt & Jason,

thanks for your support, but i cant get this running. I have tried both methods and both wont work.

Here my Action Code:

my $DepOnBy = $self->TicketObj->DependedOnBy;
while( my $dep = $DepOnBy->Next ) {
next unless( $dep->BaseURI->IsLocal );
my $orig = $dep->BaseObj->Id;
my $depon = $dep->TargetObj->Id;
$RT::Logger->debug("ORIG: $orig DEPON: $depon");
}

my $OriginalTicketObj = RT::Ticket->new($RT::SystemUser);
$OriginalTicketObj->Load($orig);

$RT::Logger->debug("TBRUMM-LWIS-TST: CustomActionCleanCode - Ende");
return 1;

---

This is the version like explained from Jason and it is not working.

And the same problem if i replace:

my $OriginalTicketObj = RT::Ticket->new($RT::SystemUser);
$OriginalTicketObj->Load($orig);

with

my $OriginalTicketObj = LoadTicket($orig);

I have now idea anymore whats going wrong at the moment.

Thanks

Torsten


Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne



-----Urspruengliche Nachricht-----
Von: rt-users-bounces [at] lists [mailto:rt-users-bounces [at] lists] Im Auftrag von Matt Zagrabelny
Gesendet: Dienstag, 17. November 2009 15:38
An: rt-users [at] lists
Betreff: Re: [rt-users] How to get TicketObj from a Ticket ID

On Tue, 2009-11-17 at 15:33 +0100, Brumm, Torsten / Kuehne + Nagel / Ham MI-ID wrote:
> Hi,
> i'm now searching since some hours how to get the TicketObj from a given Ticket ID.
>
> Normally from within a scrip i go this way: $self->TicketObj and i can
> work with all the Information (like $self->TicketObj->Status etc)
>
> Now i have only i Ticket ID stored in a variable and i'm searching a way to get back my TicketObj.

my $TicketObj = LoadTicket($id);

--
Matt Zagrabelny - mzagrabe [at] d - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot lose.
-Jim Elliot

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

Community help: http://wiki.bestpractical.com Commercial support: sales [at] bestpractical


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

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

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


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


torsten.brumm at Kuehne-Nagel

Nov 17, 2009, 7:47 AM

Post #5 of 5 (364 views)
Permalink
Re: How to get TicketObj from a Ticket ID [In reply to]

Finally i got the error. outsite the while loop the $orig variable does not exsist.

Thanks to all for the help.

Torsten

-----Ursprüngliche Nachricht-----
Von: rt-users-bounces [at] lists [mailto:rt-users-bounces [at] lists] Im Auftrag von Brumm,Torsten / Kuehne + Nagel / Ham MI-ID
Gesendet: Dienstag, 17. November 2009 16:12
An: Matt Zagrabelny; rt-users [at] lists; smithj4 [at] bnl
Betreff: Re: [rt-users] How to get TicketObj from a Ticket ID

Hi Matt & Jason,

thanks for your support, but i cant get this running. I have tried both methods and both wont work.

Here my Action Code:

my $DepOnBy = $self->TicketObj->DependedOnBy; while( my $dep = $DepOnBy->Next ) {
next unless( $dep->BaseURI->IsLocal );
my $orig = $dep->BaseObj->Id;
my $depon = $dep->TargetObj->Id;
$RT::Logger->debug("ORIG: $orig DEPON: $depon"); }

my $OriginalTicketObj = RT::Ticket->new($RT::SystemUser); $OriginalTicketObj->Load($orig);

$RT::Logger->debug("TBRUMM-LWIS-TST: CustomActionCleanCode - Ende"); return 1;

---

This is the version like explained from Jason and it is not working.

And the same problem if i replace:

my $OriginalTicketObj = RT::Ticket->new($RT::SystemUser); $OriginalTicketObj->Load($orig);

with

my $OriginalTicketObj = LoadTicket($orig);

I have now idea anymore whats going wrong at the moment.

Thanks

Torsten


Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne



-----Urspruengliche Nachricht-----
Von: rt-users-bounces [at] lists [mailto:rt-users-bounces [at] lists] Im Auftrag von Matt Zagrabelny
Gesendet: Dienstag, 17. November 2009 15:38
An: rt-users [at] lists
Betreff: Re: [rt-users] How to get TicketObj from a Ticket ID

On Tue, 2009-11-17 at 15:33 +0100, Brumm, Torsten / Kuehne + Nagel / Ham MI-ID wrote:
> Hi,
> i'm now searching since some hours how to get the TicketObj from a given Ticket ID.
>
> Normally from within a scrip i go this way: $self->TicketObj and i can
> work with all the Information (like $self->TicketObj->Status etc)
>
> Now i have only i Ticket ID stored in a variable and i'm searching a way to get back my TicketObj.

my $TicketObj = LoadTicket($id);

--
Matt Zagrabelny - mzagrabe [at] d - (218) 726 8844 University of Minnesota Duluth Information Technology Systems & Services PGP key 1024D/84E22DA2 2005-11-07
Fingerprint: 78F9 18B3 EF58 56F5 FC85 C5CA 53E7 887F 84E2 2DA2

He is not a fool who gives up what he cannot keep to gain what he cannot lose.
-Jim Elliot

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

Community help: http://wiki.bestpractical.com Commercial support: sales [at] bestpractical


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

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

Community help: http://wiki.bestpractical.com Commercial support: sales [at] bestpractical


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales [at] bestpractical


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

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.