Re: [rt-users] Help with Templates

2014-12-17 Thread Alex Peters
Simply copy everything between (and including) the outermost curly braces
in the location where you'd like a comma-separated list of ticket numbers
to appear.

Basically any curly brace construct will be replaced with something else
when the template is evaluated.

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no wrote:

 Hi,

 Thanks for your reply

 I'm fairly new RT an my perl skills at not to good either.

 How would I go about outputting this in a template?

 --
 Thomas



 On 17. des. 2014, at 00.28, Alex Peters a...@peters.net wrote:

 You're getting an RT::Links instance, which is an iterator.  I've used
 something like this with success:

 Related ticket IDs: {
   my @refers_to_ids;
   my $refers_to = $Ticket-RefersTo;
   while (my $link = $refers_to-Next) {
 next unless $link-BaseURI-IsLocal; # skip over non-ticket links
 push @refers_to_ids, $link-BaseObj-id;
   }
   return join(q{, }, map { #$_ } sort @refers_to_ids;
 }

 On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no wrote:

  Hi,

 I want to display the ID of related Tickets in my template

 I tried using this  {$Ticket-RefersTo}

 But that just returns RT::Links=HASH(0x7f6dc46f7d20)

 How can I expand this to the ID of the related object?

 Regards

 --

 Thomas




Re: [rt-users] Help with Templates

2014-12-17 Thread Thomas Westlund
Hi,

 

There seems to be an error in the code:

 

 

This is my complete template

=== CUT  HERE  ==

Subject: Ordrestatus: { $Ticket-SubjectTag }

 

Hei,

 

Her kommer ditt tilbud.

 

Vennligst behold:

 

 { $Ticket-SubjectTag }

 

emnefeltet ved fremtidig korrespodanse i denne saken.

 

Mvh,

Kvantel AS

{$Ticket-QueueObj-CorrespondAddress()}

 

---

Related ticket IDs: 

{

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal;

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

=== CUT  HERE  ==

 

 

When I try to save this template, I get the following error:

 

* Template Tilbud: Content updated

* Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to = 
$Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless 
$link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort 
@refers_to_ids; ': syntax error at template line 28

--

Regards

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net] 
Sendt: 17. desember 2014 11:57
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com
Emne: Re: [rt-users] Help with Templates

 

Simply copy everything between (and including) the outermost curly braces in 
the location where you'd like a comma-separated list of ticket numbers to 
appear.

 

Basically any curly brace construct will be replaced with something else when 
the template is evaluated.

 

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

Thanks for your reply

 

I'm fairly new RT an my perl skills at not to good either.

 

How would I go about outputting this in a template?

 

--

Thomas




On 17. des. 2014, at 00.28, Alex Peters a...@peters.net 
mailto:a...@peters.net  wrote:

You're getting an RT::Links instance, which is an iterator.  I've used 
something like this with success:

 

Related ticket IDs: {

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal; # skip over non-ticket links

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

 

On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

I want to display the ID of related Tickets in my template

I tried using this  {$Ticket-RefersTo}

But that just returns RT::Links=HASH(0x7f6dc46f7d20)

How can I expand this to the ID of the related object?

Regards

--

Thomas



Re: [rt-users] Help with Templates

2014-12-17 Thread Alex Peters
Sorry, there's a missing closing bracket on the return line.  It should be
this:

return join(q{, }, map { #$_ } sort @refers_to_ids);

On 17 December 2014 at 22:38, Thomas Westlund tho...@westlund.no wrote:

 Hi,



 There seems to be an error in the code:





 This is my complete template

 === CUT  HERE  ==

 Subject: Ordrestatus: { $Ticket-SubjectTag }



 Hei,



 Her kommer ditt tilbud.



 Vennligst behold:



  { $Ticket-SubjectTag }



 emnefeltet ved fremtidig korrespodanse i denne saken.



 Mvh,

 Kvantel AS

 {$Ticket-QueueObj-CorrespondAddress()}



 ---

 Related ticket IDs:

 {

   my @refers_to_ids;

   my $refers_to = $Ticket-RefersTo;

   while (my $link = $refers_to-Next) {

 next unless $link-BaseURI-IsLocal;

 push @refers_to_ids, $link-BaseObj-id;

   }

   return join(q{, }, map { #$_ } sort @refers_to_ids;

 }

 === CUT  HERE  ==





 When I try to save this template, I get the following error:



 · *Template Tilbud: Content updated*

 · *Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to
 = $Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless
 $link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort
 @refers_to_ids; ': syntax error at template line 28*

 --

 Regards

 Thomas



 *Fra:* Alex Peters [mailto:a...@peters.net]
 *Sendt:* 17. desember 2014 11:57
 *Til:* Thomas Westlund
 *Kopi:* rt-users@lists.bestpractical.com
 *Emne:* Re: [rt-users] Help with Templates



 Simply copy everything between (and including) the outermost curly braces
 in the location where you'd like a comma-separated list of ticket numbers
 to appear.



 Basically any curly brace construct will be replaced with something else
 when the template is evaluated.



 On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no wrote:

 Hi,



 Thanks for your reply



 I'm fairly new RT an my perl skills at not to good either.



 How would I go about outputting this in a template?



 --

 Thomas


 On 17. des. 2014, at 00.28, Alex Peters a...@peters.net wrote:

 You're getting an RT::Links instance, which is an iterator.  I've used
 something like this with success:



 Related ticket IDs: {

   my @refers_to_ids;

   my $refers_to = $Ticket-RefersTo;

   while (my $link = $refers_to-Next) {

 next unless $link-BaseURI-IsLocal; # skip over non-ticket links

 push @refers_to_ids, $link-BaseObj-id;

   }

   return join(q{, }, map { #$_ } sort @refers_to_ids;

 }



 On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no wrote:

 Hi,

 I want to display the ID of related Tickets in my template

 I tried using this  {$Ticket-RefersTo}

 But that just returns RT::Links=HASH(0x7f6dc46f7d20)

 How can I expand this to the ID of the related object?

 Regards

 --

 Thomas




Re: [rt-users] Help with Templates

2014-12-17 Thread Thomas Westlund
Hi again,

 

Seems like this is the offending line, removing it lets me save the template 
without any errors:

 

return join(q{, }, map { #$_ } sort @refers_to_ids;

--

Thomas

 

Fra: Thomas Westlund [mailto:tho...@westlund.no] 
Sendt: 17. desember 2014 12:39
Til: 'Alex Peters'
Kopi: 'rt-users@lists.bestpractical.com'
Emne: SV: [rt-users] Help with Templates

 

Hi,

 

There seems to be an error in the code:

 

 

This is my complete template

=== CUT  HERE  ==

Subject: Ordrestatus: { $Ticket-SubjectTag }

 

Hei,

 

Her kommer ditt tilbud.

 

Vennligst behold:

 

 { $Ticket-SubjectTag }

 

emnefeltet ved fremtidig korrespodanse i denne saken.

 

Mvh,

Kvantel AS

{$Ticket-QueueObj-CorrespondAddress()}

 

---

Related ticket IDs: 

{

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal;

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

=== CUT  HERE  ==

 

 

When I try to save this template, I get the following error:

 

* Template Tilbud: Content updated

* Couldn't compile template codeblock ' my @refers_to_ids; my 
$refers_to = $Ticket-RefersTo; while (my $link = $refers_to-Next) { next 
unless $link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort 
@refers_to_ids; ': syntax error at template line 28

--

Regards

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net] 
Sendt: 17. desember 2014 11:57
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Simply copy everything between (and including) the outermost curly braces in 
the location where you'd like a comma-separated list of ticket numbers to 
appear.

 

Basically any curly brace construct will be replaced with something else when 
the template is evaluated.

 

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

Thanks for your reply

 

I'm fairly new RT an my perl skills at not to good either.

 

How would I go about outputting this in a template?

 

--

Thomas


On 17. des. 2014, at 00.28, Alex Peters a...@peters.net 
mailto:a...@peters.net  wrote:

You're getting an RT::Links instance, which is an iterator.  I've used 
something like this with success:

 

Related ticket IDs: {

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal; # skip over non-ticket links

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

 

On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

I want to display the ID of related Tickets in my template

I tried using this  {$Ticket-RefersTo}

But that just returns RT::Links=HASH(0x7f6dc46f7d20)

How can I expand this to the ID of the related object?

Regards

--

Thomas



Re: [rt-users] Help with Templates

2014-12-17 Thread Thomas Westlund
Thanx, that did the trick. This is really helpful ;-)

 

This code only prints related tickets, what if the related object is an Asset? 
Is it possible to print the id of that as well?

 

--

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net] 
Sendt: 17. desember 2014 12:42
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com
Emne: Re: [rt-users] Help with Templates

 

Sorry, there's a missing closing bracket on the return line.  It should be this:

 

return join(q{, }, map { #$_ } sort @refers_to_ids);

 

On 17 December 2014 at 22:38, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

There seems to be an error in the code:

 

 

This is my complete template

=== CUT  HERE  ==

Subject: Ordrestatus: { $Ticket-SubjectTag }

 

Hei,

 

Her kommer ditt tilbud.

 

Vennligst behold:

 

 { $Ticket-SubjectTag }

 

emnefeltet ved fremtidig korrespodanse i denne saken.

 

Mvh,

Kvantel AS

{$Ticket-QueueObj-CorrespondAddress()}

 

---

Related ticket IDs: 

{

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal;

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

=== CUT  HERE  ==

 

 

When I try to save this template, I get the following error:

 

* Template Tilbud: Content updated

* Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to = 
$Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless 
$link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort 
@refers_to_ids; ': syntax error at template line 28

--

Regards

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net mailto:a...@peters.net ] 
Sendt: 17. desember 2014 11:57
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Simply copy everything between (and including) the outermost curly braces in 
the location where you'd like a comma-separated list of ticket numbers to 
appear.

 

Basically any curly brace construct will be replaced with something else when 
the template is evaluated.

 

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

Thanks for your reply

 

I'm fairly new RT an my perl skills at not to good either.

 

How would I go about outputting this in a template?

 

--

Thomas


On 17. des. 2014, at 00.28, Alex Peters a...@peters.net 
mailto:a...@peters.net  wrote:

You're getting an RT::Links instance, which is an iterator.  I've used 
something like this with success:

 

Related ticket IDs: {

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal; # skip over non-ticket links

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

 

On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

I want to display the ID of related Tickets in my template

I tried using this  {$Ticket-RefersTo}

But that just returns RT::Links=HASH(0x7f6dc46f7d20)

How can I expand this to the ID of the related object?

Regards

--

Thomas



Re: [rt-users] Help with Templates

2014-12-17 Thread Alex Peters
I personally don't have experience with assets, but hopefully someone else
on the list can assist you with modifying that code to list assets (or give
you code to list them separately).

On 17 December 2014 at 22:56, Thomas Westlund tho...@westlund.no wrote:

 Thanx, that did the trick. This is really helpful ;-)



 This code only prints related tickets, what if the related object is an
 Asset? Is it possible to print the id of that as well?



 --

 Thomas



 *Fra:* Alex Peters [mailto:a...@peters.net]
 *Sendt:* 17. desember 2014 12:42

 *Til:* Thomas Westlund
 *Kopi:* rt-users@lists.bestpractical.com
 *Emne:* Re: [rt-users] Help with Templates



 Sorry, there's a missing closing bracket on the return line.  It should be
 this:



 return join(q{, }, map { #$_ } sort @refers_to_ids);



 On 17 December 2014 at 22:38, Thomas Westlund tho...@westlund.no wrote:

 Hi,



 There seems to be an error in the code:





 This is my complete template

 === CUT  HERE  ==

 Subject: Ordrestatus: { $Ticket-SubjectTag }



 Hei,



 Her kommer ditt tilbud.



 Vennligst behold:



  { $Ticket-SubjectTag }



 emnefeltet ved fremtidig korrespodanse i denne saken.



 Mvh,

 Kvantel AS

 {$Ticket-QueueObj-CorrespondAddress()}



 ---

 Related ticket IDs:

 {

   my @refers_to_ids;

   my $refers_to = $Ticket-RefersTo;

   while (my $link = $refers_to-Next) {

 next unless $link-BaseURI-IsLocal;

 push @refers_to_ids, $link-BaseObj-id;

   }

   return join(q{, }, map { #$_ } sort @refers_to_ids;

 }

 === CUT  HERE  ==





 When I try to save this template, I get the following error:



 · *Template Tilbud: Content updated*

 · *Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to
 = $Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless
 $link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort
 @refers_to_ids; ': syntax error at template line 28*

 --

 Regards

 Thomas



 *Fra:* Alex Peters [mailto:a...@peters.net]
 *Sendt:* 17. desember 2014 11:57
 *Til:* Thomas Westlund
 *Kopi:* rt-users@lists.bestpractical.com
 *Emne:* Re: [rt-users] Help with Templates



 Simply copy everything between (and including) the outermost curly braces
 in the location where you'd like a comma-separated list of ticket numbers
 to appear.



 Basically any curly brace construct will be replaced with something else
 when the template is evaluated.



 On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no wrote:

 Hi,



 Thanks for your reply



 I'm fairly new RT an my perl skills at not to good either.



 How would I go about outputting this in a template?



 --

 Thomas


 On 17. des. 2014, at 00.28, Alex Peters a...@peters.net wrote:

 You're getting an RT::Links instance, which is an iterator.  I've used
 something like this with success:



 Related ticket IDs: {

   my @refers_to_ids;

   my $refers_to = $Ticket-RefersTo;

   while (my $link = $refers_to-Next) {

 next unless $link-BaseURI-IsLocal; # skip over non-ticket links

 push @refers_to_ids, $link-BaseObj-id;

   }

   return join(q{, }, map { #$_ } sort @refers_to_ids;

 }



 On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no wrote:

 Hi,

 I want to display the ID of related Tickets in my template

 I tried using this  {$Ticket-RefersTo}

 But that just returns RT::Links=HASH(0x7f6dc46f7d20)

 How can I expand this to the ID of the related object?

 Regards

 --

 Thomas




Re: [rt-users] Help with Templates

2014-12-17 Thread Thomas Westlund
Hi,

 

OK, hopefully someone with experience of Asses will reply.

 

Thanks for the help anyway, this was really useful ;-)

 

--

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net] 
Sendt: 17. desember 2014 12:59
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com
Emne: Re: [rt-users] Help with Templates

 

I personally don't have experience with assets, but hopefully someone else on 
the list can assist you with modifying that code to list assets (or give you 
code to list them separately).

 

On 17 December 2014 at 22:56, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Thanx, that did the trick. This is really helpful ;-)

 

This code only prints related tickets, what if the related object is an Asset? 
Is it possible to print the id of that as well?

 

--

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net mailto:a...@peters.net ] 
Sendt: 17. desember 2014 12:42


Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Sorry, there's a missing closing bracket on the return line.  It should be this:

 

return join(q{, }, map { #$_ } sort @refers_to_ids);

 

On 17 December 2014 at 22:38, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

There seems to be an error in the code:

 

 

This is my complete template

=== CUT  HERE  ==

Subject: Ordrestatus: { $Ticket-SubjectTag }

 

Hei,

 

Her kommer ditt tilbud.

 

Vennligst behold:

 

 { $Ticket-SubjectTag }

 

emnefeltet ved fremtidig korrespodanse i denne saken.

 

Mvh,

Kvantel AS

{$Ticket-QueueObj-CorrespondAddress()}

 

---

Related ticket IDs: 

{

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal;

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

=== CUT  HERE  ==

 

 

When I try to save this template, I get the following error:

 

* Template Tilbud: Content updated

* Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to = 
$Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless 
$link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort 
@refers_to_ids; ': syntax error at template line 28

--

Regards

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net mailto:a...@peters.net ] 
Sendt: 17. desember 2014 11:57
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Simply copy everything between (and including) the outermost curly braces in 
the location where you'd like a comma-separated list of ticket numbers to 
appear.

 

Basically any curly brace construct will be replaced with something else when 
the template is evaluated.

 

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

Thanks for your reply

 

I'm fairly new RT an my perl skills at not to good either.

 

How would I go about outputting this in a template?

 

--

Thomas


On 17. des. 2014, at 00.28, Alex Peters a...@peters.net 
mailto:a...@peters.net  wrote:

You're getting an RT::Links instance, which is an iterator.  I've used 
something like this with success:

 

Related ticket IDs: {

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal; # skip over non-ticket links

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

 

On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

I want to display the ID of related Tickets in my template

I tried using this  {$Ticket-RefersTo}

But that just returns RT::Links=HASH(0x7f6dc46f7d20)

How can I expand this to the ID of the related object?

Regards

--

Thomas



Re: [rt-users] Help with Templates

2014-12-17 Thread Thomas Westlund
Hi again,

 

Hmm, seems there might be something wrong or missing with the code

It only prints the ID of the current ticket, I have related two tickets to test 
it, it prints its own id two times.

 

Any tips where to start?

 

--

Thomas

 

 

Fra: Alex Peters [mailto:a...@peters.net] 
Sendt: 17. desember 2014 12:59
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com
Emne: Re: [rt-users] Help with Templates

 

I personally don't have experience with assets, but hopefully someone else on 
the list can assist you with modifying that code to list assets (or give you 
code to list them separately).

 

On 17 December 2014 at 22:56, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Thanx, that did the trick. This is really helpful ;-)

 

This code only prints related tickets, what if the related object is an Asset? 
Is it possible to print the id of that as well?

 

--

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net mailto:a...@peters.net ] 
Sendt: 17. desember 2014 12:42


Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Sorry, there's a missing closing bracket on the return line.  It should be this:

 

return join(q{, }, map { #$_ } sort @refers_to_ids);

 

On 17 December 2014 at 22:38, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

There seems to be an error in the code:

 

 

This is my complete template

=== CUT  HERE  ==

Subject: Ordrestatus: { $Ticket-SubjectTag }

 

Hei,

 

Her kommer ditt tilbud.

 

Vennligst behold:

 

 { $Ticket-SubjectTag }

 

emnefeltet ved fremtidig korrespodanse i denne saken.

 

Mvh,

Kvantel AS

{$Ticket-QueueObj-CorrespondAddress()}

 

---

Related ticket IDs: 

{

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal;

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

=== CUT  HERE  ==

 

 

When I try to save this template, I get the following error:

 

* Template Tilbud: Content updated

* Couldn't compile template codeblock ' my @refers_to_ids; my $refers_to = 
$Ticket-RefersTo; while (my $link = $refers_to-Next) { next unless 
$link-BaseURI-IsLocal; } return join(q{, }, map { #$_ } sort 
@refers_to_ids; ': syntax error at template line 28

--

Regards

Thomas

 

Fra: Alex Peters [mailto:a...@peters.net mailto:a...@peters.net ] 
Sendt: 17. desember 2014 11:57
Til: Thomas Westlund
Kopi: rt-users@lists.bestpractical.com 
mailto:rt-users@lists.bestpractical.com 
Emne: Re: [rt-users] Help with Templates

 

Simply copy everything between (and including) the outermost curly braces in 
the location where you'd like a comma-separated list of ticket numbers to 
appear.

 

Basically any curly brace construct will be replaced with something else when 
the template is evaluated.

 

On 17 December 2014 at 18:36, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

 

Thanks for your reply

 

I'm fairly new RT an my perl skills at not to good either.

 

How would I go about outputting this in a template?

 

--

Thomas


On 17. des. 2014, at 00.28, Alex Peters a...@peters.net 
mailto:a...@peters.net  wrote:

You're getting an RT::Links instance, which is an iterator.  I've used 
something like this with success:

 

Related ticket IDs: {

  my @refers_to_ids;

  my $refers_to = $Ticket-RefersTo;

  while (my $link = $refers_to-Next) {

next unless $link-BaseURI-IsLocal; # skip over non-ticket links

push @refers_to_ids, $link-BaseObj-id;

  }

  return join(q{, }, map { #$_ } sort @refers_to_ids;

}

 

On 17 December 2014 at 07:51, Thomas Westlund tho...@westlund.no 
mailto:tho...@westlund.no  wrote:

Hi,

I want to display the ID of related Tickets in my template

I tried using this  {$Ticket-RefersTo}

But that just returns RT::Links=HASH(0x7f6dc46f7d20)

How can I expand this to the ID of the related object?

Regards

--

Thomas



Re: [rt-users] How do the 'One-time Cc' and 'One-time Bcc' lists get populated

2014-12-17 Thread k...@rice.edu
On Wed, Dec 17, 2014 at 10:45:19AM +1100, Alex Peters wrote:
 The One-time Cc list is constructed by collecting all of the addresses
 related to all of the ticket's transactions and then removing addresses
 belonging to requestors.
 
 Is someone still regularly CC-ing this departed user in new tickets?
 Alternatively (although I'm not sure that this is relevant), is that RT
 user set up as a queue-level CC?
 
 By adding this user's address to the $RTAddressRegexp regex, you're telling
 RT that it directly receives mail to that address, which could have
 unintended consequences (e.g. inability to add or re-add this email address
 to tickets).
 

Hi Alex,

I know about the pitfall of using $RTAddressRegexp but the problem
I have is that even for new test tickets created by Email that I send
which definitely does not have the address in question as a Cc, the
address is added as a one-time Cc/Bcc option. :( I tried to find a
commandline script to pull the addresses to see if I could figure out
where the address is originating, but I did not succeed. It would be
fine if the address was only added if it was Cc-ed earlier.

Regards,
Ken

 On 17 December 2014 at 06:39, k...@rice.edu k...@rice.edu wrote:
 
  On Mon, Dec 15, 2014 at 04:08:52PM -0600, k...@rice.edu wrote:
   Hi RT Users,
  
   I am trying to clear an address that keeps appearing in the
   One-time Cc/Bcc list on the Reply form for a ticket. The user
   is no longer here, but the address keeps showing up in the
   Reply form for new tickets. How is that list constructed?
  
   Regards,
   Ken
  
 
  Okay. It looks like I can add the address to the $RTAddressRegexp
  and it will remove it. I was hoping that there was some type of
  DB/shredder/GUI action that could be used instead of polluting
  the regex.
 
  Regards,
  Ken
 


Re: [rt-users] How do the 'One-time Cc' and 'One-time Bcc' lists get populated

2014-12-17 Thread Kevin Falcone
On Wed, Dec 17, 2014 at 08:55:20AM -0600, k...@rice.edu wrote:
 I have is that even for new test tickets created by Email that I send
 which definitely does not have the address in question as a Cc, the
 address is added as a one-time Cc/Bcc option. :( I tried to find a
 commandline script to pull the addresses to see if I could figure out
 where the address is originating, but I did not succeed. It would be
 fine if the address was only added if it was Cc-ed earlier.

[I'm assuming you mean the checkboxes that appear near
one-time-cc/one-time-bcc]

That list comes from Ticket-TransactionAddresses which calls
Attachment-Addresses and it looks on From/To/Cc/a few other things on
each correspond/comment in the ticket, so somewhere in there, that
email must appear.  Maybe the code (which is quite simplistic) will
shed some light.

-kevin


pgpkWNIznNnBy.pgp
Description: PGP signature


[rt-users] warning message on set ReferTo

2014-12-17 Thread Payam Poursaied
Hi All
I have created a script which has below command to create a link
$Ticket-AddLink(Type='RefersTo',Target=$pticket_id,RecordTransactiosn=0)
;

When I run the script ReferTo link created, but I got below warning as well.
RT version 4.2.8
And line 149 of 02.pl is exit line.

Any idea?

[85829] [Wed Dec 17 07:14:20 2014] [warning]: RT::Handle=HASH(0x802572648)
couldn't execute the query 'SELECT  * FROM Tickets WHERE id = ?' at
/usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Handle.pm line 602.
   
DBIx::SearchBuilder::Handle::SimpleQuery(RT::Handle=HASH(0x802572648),
SELECT  * FROM Tickets WHERE id = ?, 3311056) called at
/usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record.pm line 1234
   
DBIx::SearchBuilder::Record::_LoadFromSQL(RT::Ticket=HASH(0x80e255cf0),
SELECT  * FROM Tickets WHERE id = ?, 3311056) called at
/usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record.pm line 1153
   
DBIx::SearchBuilder::Record::LoadByCols(RT::Ticket=HASH(0x80e255cf0), id,
3311056) called at
/usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record/Cachable.pm
line 120
   
DBIx::SearchBuilder::Record::Cachable::LoadByCols(RT::Ticket=HASH(0x80e255cf
0), id, 3311056) called at /opt/rt4/lib//RT/Record.pm line 396
    RT::Record::LoadByCols(RT::Ticket=HASH(0x80e255cf0), id, 3311056)
called at /usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record.pm
line 1168
    DBIx::SearchBuilder::Record::LoadById(RT::Ticket=HASH(0x80e255cf0),
3311056) called at /opt/rt4/lib//RT/Ticket.pm line 146
    RT::Ticket::Load(RT::Ticket=HASH(0x80e255cf0), 3311056) called at
/opt/rt4/lib//RT/Ticket.pm line 2581
    RT::Ticket::_ApplyTransactionBatch(RT::Ticket=HASH(0x80dd1a9f0))
called at /opt/rt4/lib//RT/Ticket.pm line 2569
    RT::Ticket::ApplyTransactionBatch(RT::Ticket=HASH(0x80dd1a9f0))
called at /opt/rt4/lib//RT/Ticket.pm line 2639
    RT::Ticket::DESTROY(RT::Ticket=HASH(0x80dd1a9f0)) called at 02.pl
line 149
    eval {...} called at 02.pl line 149
(/usr/local/lib/perl5/site_perl/5.14.2/Carp.pm:169)



[rt-users] Custom condition not working (simple)

2014-12-17 Thread Matt Smith
How come this does not work?  I've seen some examples of the DependOnBy use 
returning a numeric value, but looking at RT documentation, it appears it 
should return an array?  Basically, I want it to return 1 if there are no child 
tickets associated with the current ticket.

if ($self-TransactionObj-Type eq 'Create' 
$self-TicketObj-FirstCustomFieldValue('New Hire Request?')eq 'Yes' 
$self-TicketObj-DependOnBy eq '0') {
return 1;
}

Is there a way to test RT perl code without trial and error, or do you just 
have to incorporate some logging?

Thanks!

-Matt





Re: [rt-users] Custom condition not working (simple)

2014-12-17 Thread Kevin Falcone
On Wed, Dec 17, 2014 at 06:11:03PM +, Matt Smith wrote:
 How come this does not work?  I’ve seen some examples of the “DependOnBy” use
 returning a numeric value, but looking at RT documentation, it appears it
 should return an array?  Basically, I want it to return 1 if there are no 
 child
 tickets associated with the current ticket. 

First up - it's DependedOnBy not DependOnBy, and it returns an
RT::Links object, so I'm surprised you've seen numeric comparisons.

I suspect you wanted
http://bestpractical.com/docs/rt/latest/RT/Record.html#HasUnresolvedDependencies

 Is there a way to test RT perl code without trial and error, or do you just
 have to incorporate some logging?

Logging is your friend.

RT-Logger-error(Stuff);

You can also always write a command line program to test things
quickly, which is what I usually do.

-kevin


pgpoYvLQA2Hng.pgp
Description: PGP signature


Re: [rt-users] Custom condition not working (simple)

2014-12-17 Thread Matt Smith
I'm not sure either.   This was very helpful - thanks for the response!

-Original Message-
From: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of 
Kevin Falcone
Sent: Wednesday, December 17, 2014 11:15 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom condition not working (simple)

On Wed, Dec 17, 2014 at 06:11:03PM +, Matt Smith wrote:
 How come this does not work?  I’ve seen some examples of the 
 “DependOnBy” use returning a numeric value, but looking at RT 
 documentation, it appears it should return an array?  Basically, I 
 want it to return 1 if there are no child tickets associated with the current 
 ticket.

First up - it's DependedOnBy not DependOnBy, and it returns an RT::Links 
object, so I'm surprised you've seen numeric comparisons.

I suspect you wanted
http://bestpractical.com/docs/rt/latest/RT/Record.html#HasUnresolvedDependencies

 Is there a way to test RT perl code without trial and error, or do you 
 just have to incorporate some logging?

Logging is your friend.

RT-Logger-error(Stuff);

You can also always write a command line program to test things quickly, which 
is what I usually do.

-kevin


Re: [rt-users] Custom condition not working (simple)

2014-12-17 Thread Matt Smith
I meant to say I want it to return 1 if there are no PARENT tickets to the 
current ticket.   I would need to use the DependsOn or AllDependsOn, but 
I'm not sure how to check the returned array for size.

Working on it.

-Original Message-
From: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of 
Kevin Falcone
Sent: Wednesday, December 17, 2014 11:15 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Custom condition not working (simple)

On Wed, Dec 17, 2014 at 06:11:03PM +, Matt Smith wrote:
 How come this does not work?  I’ve seen some examples of the 
 “DependOnBy” use returning a numeric value, but looking at RT 
 documentation, it appears it should return an array?  Basically, I 
 want it to return 1 if there are no child tickets associated with the current 
 ticket.

First up - it's DependedOnBy not DependOnBy, and it returns an RT::Links 
object, so I'm surprised you've seen numeric comparisons.

I suspect you wanted
http://bestpractical.com/docs/rt/latest/RT/Record.html#HasUnresolvedDependencies

 Is there a way to test RT perl code without trial and error, or do you 
 just have to incorporate some logging?

Logging is your friend.

RT-Logger-error(Stuff);

You can also always write a command line program to test things quickly, which 
is what I usually do.

-kevin


Re: [rt-users] How do the 'One-time Cc' and 'One-time Bcc' lists get populated

2014-12-17 Thread k...@rice.edu
On Wed, Dec 17, 2014 at 11:50:38AM -0500, Kevin Falcone wrote:
 On Wed, Dec 17, 2014 at 08:55:20AM -0600, k...@rice.edu wrote:
  I have is that even for new test tickets created by Email that I send
  which definitely does not have the address in question as a Cc, the
  address is added as a one-time Cc/Bcc option. :( I tried to find a
  commandline script to pull the addresses to see if I could figure out
  where the address is originating, but I did not succeed. It would be
  fine if the address was only added if it was Cc-ed earlier.
 
 [I'm assuming you mean the checkboxes that appear near
 one-time-cc/one-time-bcc]
 
 That list comes from Ticket-TransactionAddresses which calls
 Attachment-Addresses and it looks on From/To/Cc/a few other things on
 each correspond/comment in the ticket, so somewhere in there, that
 email must appear.  Maybe the code (which is quite simplistic) will
 shed some light.
 
 -kevin

Hi Kevin,

Thank you for the information. I checked out the code and it is quite
basic, as you mentioned. I know that I did not have the Email address
in question in my test Emails so I do not know where it would have
come from. Is there any type of caching within the RT backends or
maybe the browsers that could cause that behavior? Thank you again
for the update.

Regards,
Ken


Re: [rt-users] warning message on set ReferTo

2014-12-17 Thread Alex Peters
I can't see any obvious problems based on your error messages.

There seems to be a typo in the code.  Is that directly copied from your
script?

Have you considered enabling debugging from within your script?

On Thu, 18 Dec 2014 5:04 am Payam Poursaied m...@payam124.com wrote:

 Hi All
 I have created a script which has below command to create a link
 $Ticket-AddLink(Type='RefersTo',Target=$pticket_id,
 RecordTransactiosn=0)
 ;

 When I run the script ReferTo link created, but I got below warning as
 well.
 RT version 4.2.8
 And line 149 of 02.pl is exit line.

 Any idea?

 [85829] [Wed Dec 17 07:14:20 2014] [warning]: RT::Handle=HASH(0x802572648)
 couldn't execute the query 'SELECT  * FROM Tickets WHERE id = ?' at
 /usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Handle.pm line
 602.

 DBIx::SearchBuilder::Handle::SimpleQuery(RT::Handle=HASH(0x802572648),
 SELECT  * FROM Tickets WHERE id = ?, 3311056) called at
 /usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record.pm line
 1234

 DBIx::SearchBuilder::Record::_LoadFromSQL(RT::Ticket=HASH(0x80e255cf0),
 SELECT  * FROM Tickets WHERE id = ?, 3311056) called at
 /usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record.pm line
 1153

 DBIx::SearchBuilder::Record::LoadByCols(RT::Ticket=HASH(0x80e255cf0),
 id,
 3311056) called at
 /usr/local/lib/perl5/site_perl/5.14.2/DBIx/SearchBuilder/Record/Cachable.
 pm
 line 120

 DBIx::SearchBuilder::Record::Cachable::LoadByCols(RT::
 Ticket=HASH(0x80e255cf
 0), id, 3311056) called at /opt/rt4/lib//RT/Record.pm line 396
 RT::Record::LoadByCols(RT::Ticket=HASH(0x80e255cf0), id,
 3311056)
 called at /usr/local/lib/perl5/site_perl/5.14.2/DBIx/
 SearchBuilder/Record.pm
 line 1168
 DBIx::SearchBuilder::Record::LoadById(RT::Ticket=HASH(
 0x80e255cf0),
 3311056) called at /opt/rt4/lib//RT/Ticket.pm line 146
 RT::Ticket::Load(RT::Ticket=HASH(0x80e255cf0), 3311056) called at
 /opt/rt4/lib//RT/Ticket.pm line 2581
 RT::Ticket::_ApplyTransactionBatch(RT::Ticket=HASH(0x80dd1a9f0))
 called at /opt/rt4/lib//RT/Ticket.pm line 2569
 RT::Ticket::ApplyTransactionBatch(RT::Ticket=HASH(0x80dd1a9f0))
 called at /opt/rt4/lib//RT/Ticket.pm line 2639
 RT::Ticket::DESTROY(RT::Ticket=HASH(0x80dd1a9f0)) called at 02.pl
 line 149
 eval {...} called at 02.pl line 149
 (/usr/local/lib/perl5/site_perl/5.14.2/Carp.pm:169)