Re: [rt-users] Web GUI allow resolve stalled tickets

2016-07-12 Thread Jon Witts via rt-users
--- Begin Message ---
Hi Andy,

I think you will need to define a custom Lifecycle in your RT Config file.
Have a read of this doc page:
https://docs.bestpractical.com/rt/4.2.13/customizing/lifecycles.html#Actions

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Website: www.queenmargarets.com

On 11 July 2016 at 16:51, Andy Smith <a.sm...@ldex.co.uk> wrote:

> Hi,
>
>   I've been working on a solution whereby a ticket is marked stalled if
> the last update is from a non-internal email address. By this I can work
> out if a ticket has been awaiting customer action, and if it has and has
> not been updated in X days I can auto close that ticket via rt-crontool by
> searching for stalled tickets etc. It seems to work quite nicely but I've
> just noticed that in the web GUI you cannot directly resolve stalled
> tickets which is annoying as it makes resolving tickets a 2 step process
> for our support team. Can I customise the web GUI to show "resolve" on the
> actions menu for stalled tickets easily?
>
>
>
> Or if anyone has any other take on my original problem and solution all
> suggestions welcomed :)
>
>
>
> thanks in advance, Andy.
>
>
>
> PS We're running RT 4.2.12
>
>
> -
> RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
> * Los Angeles - September, 2016
>
>
--- End Message ---
-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016


Re: [rt-users] Help with Scrip for child / dependent tickets

2015-05-22 Thread Jon Witts
Hi Chris,

Thanks for the pointer; I will update the scrip accordingly.

Thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 

-Original Message-
From: Christian Loos [mailto:cl...@netcologne.de] 
Sent: 22 May 2015 13:38
To: Jon Witts
Subject: Re: Help with Scrip for child / dependent tickets

Hi,

 next unless( $l-BaseObj-Status =~ 
 /^(?:new|open|stalled|pending|planning|holiday)$/ );
Actually this line uses a hard coded list of statuses.
Once you change the lifecycle for a queue, this maybe won't work any more. So 
it is better to use the IsInactiveStatus or IsActiveStatus methods on a queue 
object, which respects lifecycle changes.

Chris



[rt-users] Help with Scrip for child / dependent tickets

2015-05-08 Thread Jon Witts
Hi there,

We are wanting to have a scrip run on our queues which will move a ticket back 
to the open state if all of its child and dependent tickets are closed 
(resolved, rejected or deleted).

I have found Ruslan's scrip which opens a ticket once all of its child tickets 
are closed here on the wiki: 
http://requesttracker.wikia.com/wiki/OpenTicketOnAllMemberResolve which works 
great. However we have tried to edit this to work on depending / dependent 
tickets but cannot get it working. Here is the scrip, can anyone see what we 
are missing?



# end if setting this ticket to resolved, deleted or rejected
return 1 if ($self-TransactionObj-NewValue !~ 
/^(?:resolved|deleted|rejected)$/);

  # current ticket is a dependant of (Depended on by some parents)
  my $DependedOnBy = $self-TicketObj-DependedOnBy;
  while( my $l = $DependedOnBy-Next ) {
# we can't check non local objects
next unless( $l-TargetURI-IsLocal );
# if dependant ticket is not in active state then scrip can skip it
next unless( $l-TargetObj-Status =~ 
/^(?:new|open|stalled|pending|planning|holiday)$/ );
 
# the dependant ticket has dependencies (current ticket is one of them)
my $ds = $l-TargetObj-DependsOn();
 
my $flag = 0;
while( my $d = $ds-Next ) {
  next unless( $d-BaseURI-IsLocal );
  next unless( $d-BaseObj-Status =~ 
/^(?:new|open|stalled|pending|planning|holiday)$/ );
  $flag = 1;
  last;
}
# shouldn't open dependant if some dependency is active
next if( $flag );
# All dependent tickets closed - open depending ticket
$l-TargetObj-SetStatus('open');
  }
  
return 1;

--

Once we can get this scrip working we would ideally like a single scrip which 
will check all tickets on status change to see if it has a parent or depending 
ticket; and then if all child or dependent tickets for its parent are closed, 
to reopen the parent...

Any help greatly received!

Jon


-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net



[rt-users] AllowUserAutocompleteForUnprivileged only works for first email

2015-01-22 Thread Jon Witts
Hi all,

I have enabled the AllowUserAutocompleteForUnprivileged setting in our 
RT_SiteConfig.pm (RT version 4.2.3) and our unprivileged users now get an 
autocomplete when they are typing CC addresses into the self-service tickets. 
However, unlike the privileged users interface, when you enter a comma after 
the first CC address and start typing a second self-service does not 
autocomplete for the second and subsequent email addresses. In the main RT 
interface the behaviour is as expected.

Is there an additional config setting I need, or is this a bug in the Self 
Service interface?

Many thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net



[rt-users] Custom Ticket Display

2014-11-05 Thread Jon Witts
Hello list,

I am setting up a queue for our premise and estate department and they have 
requested the ability to print off a ticket so that it can be handed to the 
tradesman who will be handling the job. The issue is that they only want a 
certain subset of the ticket metadata to be displayed and only really need the 
ticket comments and correspondences showing, not the system notifications.

I have been reading around the wiki and the web and I think that a custom 
callback: http://requesttracker.wikia.com/wiki/CustomizingWithCallbacks might 
be what I need, but I am left with a few questions after reading that 
documentation:

1.) I would like this ticket display to be an additional type of display, not a 
replacement for the existing Display.html. Is this possible with custom 
callbacks?
2.) I would also like to be able to include a link to this custom display in 
the tickets action menu. Again is this possible, and if so how would I go about 
doing it?

Many thanks for any pointers!

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net



Re: [rt-users] Gravatar-inclusive theme or similar?

2014-09-02 Thread Jon Witts
Hi Jeff,

Have you looked at this: 
http://search.cpan.org/dist/RT-Extension-Gravatar/lib/RT/Extension/Gravatar.pm 

Does the job for us!

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of 
Jeff Blaine
Sent: 02 September 2014 14:08
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Gravatar-inclusive theme or similar?

Connecting with humans is important. Faces mean something.

I looked around and could not find anything - has anyone developed a theme 
(probably a plugin would be required I guess) that includes Gravatars or 
similar in at least ticket display?
--
RT Training - Boston, September 9-10
http://bestpractical.com/training


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training


Re: [rt-users] Upgrade-Database make***Fehler 254

2014-08-21 Thread Jon Witts
If you installed via apt-get I do not think you will be able to manually 
upgrade to 4.2.6. If you want to use the latest version of RT then you should 
download, compile ans install it manually. RT 4.2 is not available until Debian 
Sid (Unstable): 
https://packages.debian.org/search?suite=sidsearchon=nameskeywords=rt4

Jon



Director of Digital Strategy
Queen Margaret's School
01904 727600

http://www.queenmargarets.com


From: rt-users [rt-users-boun...@lists.bestpractical.com] on behalf of 
Dergeiletyp [twage...@elomech.de]
Sent: 22 August 2014 6:27 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Upgrade-Database make***Fehler 254

Hey, i am using Debian 7 Squeeze. I installed rt4.0.7 via apt-get so far, and 
its running... but i can upgrade to version 4.2.6 I get this Error: 
Upgrade-Database make***Fehler 254 How can i fix ths

View this message in context: Upgrade-Database make***Fehler 
254http://requesttracker.8502.n7.nabble.com/Upgrade-Database-make-Fehler-254-tp58370.html
Sent from the Request Tracker - User mailing list 
archivehttp://requesttracker.8502.n7.nabble.com/Request-Tracker-User-f3.html 
at Nabble.com.


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training

Re: [rt-users] Mass email creating Tickets

2014-06-03 Thread Jon Witts
Would it not be easier to remove your queue email from the distribution list; 
or am missing something?

Jon

Sent from my Android phone using TouchDown (www.nitrodesk.com)

-Original Message-
From: AdamThomas [adam.tho...@sgs.com]
Received: Tuesday, 03 Jun 2014, 20:52
To: rt-users@lists.bestpractical.com [rt-users@lists.bestpractical.com]
Subject: [rt-users] Mass email creating Tickets

Hi Guys I am fairly new to this RT stuff but a question I have is about
scrips. I need a way to stop a ticket from being created when the email
address provided is on a mass email. I have an email address which is used
for users to send in a ticket, but the email is also on a countrywide
distribution list which HR, Health and safety, etc use, everytime they send
a mass email to everyone it creates a ticket in my RT. In my scrips I am
able to change statuses depending on queues etc but when writing a scrip to
sort this out I am stuck.

I figure if I am able to say Email was sent to more than one person
therefore update status to deleted.

However, I am unsure on how to do such a thing. Any ideas?

Thanks



--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Mass-email-creating-Tickets-tp57582.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.
--
RT Training - Boston, September 9-10
http://bestpractical.com/training



This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training

Re: [rt-users] rt-crontool oddity

2014-05-23 Thread Jon Witts
Apologies; just hit reply instead of reply to all.

I will keep an eye open for the 4.2.5 release.

Thanks,
Jon

Sent from my Android phone using TouchDown (www.nitrodesk.com)

-Original Message-
From: Alex Vandiver [ale...@bestpractical.com]
Received: Friday, 23 May 2014, 16:58
To: Jon Witts [jwi...@queenmargarets.com]; rt-users@lists.bestpractical.com 
[rt-users@lists.bestpractical.com]
Subject: Re: [rt-users] rt-crontool oddity

On 05/23/2014 11:40 AM, Jon Witts wrote:
 [snip]

Please keep replies on-list.

 Is this planned to be merged into the core branch soon?

I expect so.  Due to the ckeditor-paste bug, I expect to ship a 4.2.5
relatively quickly; it is my hope that 4.2/cron-template-caching will be
merged prior to that, but for now it is still in branch review.
 - Alex



This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training - Boston, September 9-10
http://bestpractical.com/training

Re: [rt-users] Set Custom field in template

2014-03-05 Thread Jon Witts
So I decided to leave this alone yesterday and have a look again with fresh 
eyes this morning...

Changing our rt-crontool command to this:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::RecordCorrespondence --template 'Auto-Close Warning HTML' 
--transaction last --verbose --log debug

produces the expected results.

Can anyone explain why using the action RT::Action::Notify would produce the 
effect of only using the first ticket variables when it runs through the 
template?

Thanks,
Jon


-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 

-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 16:24
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

When running this using the built-in Auto Reply template we are seeing the same 
issue:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' AND 
'CF.{Auto-Close Reminder}' NOT LIKE 'TRUE' --action RT::Action::Notify 
--action-arg 'All' --template 'Autoreply in HTML' --transaction last --verbose

Is this a bug with how rt-crontool is running or is there something 
fundamentally wrong with my rt-crontool command?

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 16:01
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Looking further into this... 

When we run:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::Notify --action-arg 'All' --template 'Auto-Close Warning 
HTML' --transaction last --verbose

The template is only setting the custom field on the first ticket in the 
search; but also the notification emails for all tickets in the search are not 
getting their ticket object, they are using the ticket object from the first 
returned ticket in the search. 

i.e.  The template code is this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

and we have 4 tickets returned by our search. Every ticket has a notification 
email sent but the $Ticket-Subject variable for all notifications on all 4 
tickets is the value of the first tickets subject... I guess this explains why 
only the first ticket is having its custom field updated, but how do we use 
rt-crontool to update multiple tickets and send out emails?

Thanks,
Jon
-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 15:49
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Hi Jim,

I have edited my template code to this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

Which now works; but only when the search from rt-crontool returns just one 
ticket. If the search returns more than one ticket then only the first ticket 
has it's CF changed, all others remain the same. The email is sent for the 
other tickets however...

What do I need to do so that the template runs this setting CF code for each 
ticket in the search?

Many thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 



On 3/4/14

Re: [rt-users] Set Custom field in template

2014-03-05 Thread Jon Witts
I have logged this as a bug over here: 
http://issues.bestpractical.com/Ticket/Display.html?id=29454 

For now I am having to use a combination of the 
RT::Action::RecordCorrespondence action and then running another cron job 
immediately afterwards to switch the status of those tickets back to stalled...

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 05 March 2014 09:14
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

So I decided to leave this alone yesterday and have a look again with fresh 
eyes this morning...

Changing our rt-crontool command to this:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::RecordCorrespondence --template 'Auto-Close Warning HTML' 
--transaction last --verbose --log debug

produces the expected results.

Can anyone explain why using the action RT::Action::Notify would produce the 
effect of only using the first ticket variables when it runs through the 
template?

Thanks,
Jon


-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 

-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 16:24
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

When running this using the built-in Auto Reply template we are seeing the same 
issue:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' AND 
'CF.{Auto-Close Reminder}' NOT LIKE 'TRUE' --action RT::Action::Notify 
--action-arg 'All' --template 'Autoreply in HTML' --transaction last --verbose

Is this a bug with how rt-crontool is running or is there something 
fundamentally wrong with my rt-crontool command?

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 16:01
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Looking further into this... 

When we run:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::Notify --action-arg 'All' --template 'Auto-Close Warning 
HTML' --transaction last --verbose

The template is only setting the custom field on the first ticket in the 
search; but also the notification emails for all tickets in the search are not 
getting their ticket object, they are using the ticket object from the first 
returned ticket in the search. 

i.e.  The template code is this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

and we have 4 tickets returned by our search. Every ticket has a notification 
email sent but the $Ticket-Subject variable for all notifications on all 4 
tickets is the value of the first tickets subject... I guess this explains why 
only the first ticket is having its custom field updated, but how do we use 
rt-crontool to update multiple tickets and send out emails?

Thanks,
Jon
-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 15:49
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Hi Jim,

I have edited my template code to this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject

[rt-users] Set Custom field in template

2014-03-04 Thread Jon Witts
Hi all,

I am trying to use a template to set a ticket custom field so that we can 
configure RT to send out reminders when a ticket has been stalled for a week. 
We are running RT 4.2.0

The command I am passing to rt-crontool is as follows:



rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' AND 
Subject LIKE 'email' --action RT::Action::Notify --action-arg 'All' --template 
'Auto-Close Warning HTML' --verbose

-

and the contents of the template Auto-Close Warning HTML is as follows:

--

my $CFName = 'Auto-Close Reminder';
my $DefaultValue = 'TRUE';

unless( $self-Ticket-FirstCustomFieldValue( $CFName ) eq $DefaultValue ) {
my( $st, $msg ) = $self-Ticket-AddCustomFieldValue(
Field = $CFName,
Value = $DefaultValue,
RecordTransaction = 1 );
}

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b,
has been in a stalled state awaiting further information from yourself for a 
week. This ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

pIf you do not respond with the requested information within 7 days then we 
will assume that this support request is no longer required and automatically 
close this request./p

pYou may reply to this message to provide us with the required information, 
or you can visit the helpdesk to see all of your current support requests here: 
/p

pThank you,br/
{$Ticket-QueueObj-CorrespondAddress()}/p

--

This is giving me the following error:

---

[error]: Template parsing error: Can't call method Ticket on an undefined 
value at template line 5. (/opt/rt4/bin/../lib/RT/Template.pm:542)

---

My Perl is very basic (to say the least!) and I have pulled this code together 
from searching around. Could anyone on the list highlight where I am going 
wrong?

Thanks,
Jon


-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 



This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training London, March 19-20 and Dallas May 20-21
http://bestpractical.com/training


Re: [rt-users] Set Custom field in template

2014-03-04 Thread Jon Witts
Hi Jim,

I have edited my template code to this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b,
has been in a stalled state awaiting further information from yourself for a 
week. This ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

Which now works; but only when the search from rt-crontool returns just one 
ticket. If the search returns more than one ticket then only the first ticket 
has it's CF changed, all others remain the same. The email is sent for the 
other tickets however...

What do I need to do so that the template runs this setting CF code for each 
ticket in the search?

Many thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 



On 3/4/14 6:13 AM, Jon Witts wrote:
 and the contents of the template Auto-Close Warning HTML is as follows:

 --

 my $CFName = 'Auto-Close Reminder';
 my $DefaultValue = 'TRUE';

 unless( $self-Ticket-FirstCustomFieldValue( $CFName ) eq $DefaultValue ) {
   my( $st, $msg ) = $self-Ticket-AddCustomFieldValue(
   Field = $CFName,
  Value = $DefaultValue,
  RecordTransaction = 1 );
   }

 Subject: Auto-Close Warning: {$Ticket-Subject}

I think your issue is after the 'unless' where you're calling Ticket on 
$self. In templates the ticket object is available as just $Ticket as in 
the Subject line above. Try switching your $self-Ticket to $Ticket 
anywhere you're calling $self in the template.

More docs on templates are available here:

http://bestpractical.com/docs/rt/latest/customizing/templates.html

You'll also need to put that initial code in some curly braces { } 
inside the template. More info here:

https://metacpan.org/pod/Text::Template

--



This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training London, March 19-20 and Dallas May 20-21
http://bestpractical.com/training


Re: [rt-users] Set Custom field in template

2014-03-04 Thread Jon Witts
Looking further into this... 

When we run:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::Notify --action-arg 'All' --template 'Auto-Close Warning 
HTML' --transaction last --verbose

The template is only setting the custom field on the first ticket in the 
search; but also the notification emails for all tickets in the search are not 
getting their ticket object, they are using the ticket object from the first 
returned ticket in the search. 

i.e.  The template code is this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b,
has been in a stalled state awaiting further information from yourself for a 
week. This ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

and we have 4 tickets returned by our search. Every ticket has a notification 
email sent but the $Ticket-Subject variable for all notifications on all 4 
tickets is the value of the first tickets subject... I guess this explains why 
only the first ticket is having its custom field updated, but how do we use 
rt-crontool to update multiple tickets and send out emails?

Thanks,
Jon
-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 15:49
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Hi Jim,

I have edited my template code to this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

Which now works; but only when the search from rt-crontool returns just one 
ticket. If the search returns more than one ticket then only the first ticket 
has it's CF changed, all others remain the same. The email is sent for the 
other tickets however...

What do I need to do so that the template runs this setting CF code for each 
ticket in the search?

Many thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 



On 3/4/14 6:13 AM, Jon Witts wrote:
 and the contents of the template Auto-Close Warning HTML is as follows:

 --

 my $CFName = 'Auto-Close Reminder';
 my $DefaultValue = 'TRUE';

 unless( $self-Ticket-FirstCustomFieldValue( $CFName ) eq $DefaultValue ) {
   my( $st, $msg ) = $self-Ticket-AddCustomFieldValue(
   Field = $CFName,
  Value = $DefaultValue,
  RecordTransaction = 1 );
   }

 Subject: Auto-Close Warning: {$Ticket-Subject}

I think your issue is after the 'unless' where you're calling Ticket on $self. 
In templates the ticket object is available as just $Ticket as in the Subject 
line above. Try switching your $self-Ticket to $Ticket anywhere you're calling 
$self in the template.

More docs on templates are available here:

http://bestpractical.com/docs/rt/latest/customizing/templates.html

You'll also need to put that initial code in some curly braces { } inside the 
template. More info here:

https://metacpan.org/pod/Text::Template

--



This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

--
RT Training London, March 19-20 and Dallas May 20-21 
http://bestpractical.com/training


This email has been processed by Smoothwall Anti-Spam - www.smoothwall.net

-- 
RT Training London, March 19-20 and Dallas May 20-21
http://bestpractical.com/training


Re: [rt-users] Set Custom field in template

2014-03-04 Thread Jon Witts
When running this using the built-in Auto Reply template we are seeing the same 
issue:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' AND 
'CF.{Auto-Close Reminder}' NOT LIKE 'TRUE' --action RT::Action::Notify 
--action-arg 'All' --template 'Autoreply in HTML' --transaction last --verbose

Is this a bug with how rt-crontool is running or is there something 
fundamentally wrong with my rt-crontool command?

Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 16:01
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Looking further into this... 

When we run:

rt-crontool --search RT::Search::FromSQL --search-arg Queue = 'Estate' 
--action RT::Action::Notify --action-arg 'All' --template 'Auto-Close Warning 
HTML' --transaction last --verbose

The template is only setting the custom field on the first ticket in the 
search; but also the notification emails for all tickets in the search are not 
getting their ticket object, they are using the ticket object from the first 
returned ticket in the search. 

i.e.  The template code is this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

and we have 4 tickets returned by our search. Every ticket has a notification 
email sent but the $Ticket-Subject variable for all notifications on all 4 
tickets is the value of the first tickets subject... I guess this explains why 
only the first ticket is having its custom field updated, but how do we use 
rt-crontool to update multiple tickets and send out emails?

Thanks,
Jon
-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 


-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jon Witts
Sent: 04 March 2014 15:49
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Set Custom field in template

Hi Jim,

I have edited my template code to this:

Subject: Auto-Close Warning: {$Ticket-Subject}
Content-Type: text/html

!--{$Ticket-AddCustomFieldValue(Field = 'Auto-Close Reminder', Value = 
'TRUE', RecordTransaction = 1 );}--

pHello,/p

pThis message has been automatically generated to let you know that your  
support request regarding b{$Ticket-Subject()}/b, has been in a 
stalled state awaiting further information from yourself for a week. This 
ticket was assigned an ID of b{$Ticket-SubjectTag}/b./p

Which now works; but only when the search from rt-crontool returns just one 
ticket. If the search returns more than one ticket then only the first ticket 
has it's CF changed, all others remain the same. The email is sent for the 
other tickets however...

What do I need to do so that the template runs this setting CF code for each 
ticket in the search?

Many thanks,
Jon

-

Jon Witts
Director of Digital Strategy
Queen Margaret's School
Escrick Park
York YO19 6EU

Telephone: 01904 727600
Fax: 01904 728150

Website: www.queenmargarets.com 



On 3/4/14 6:13 AM, Jon Witts wrote:
 and the contents of the template Auto-Close Warning HTML is as follows:

 --

 my $CFName = 'Auto-Close Reminder';
 my $DefaultValue = 'TRUE';

 unless( $self-Ticket-FirstCustomFieldValue( $CFName ) eq $DefaultValue ) {
   my( $st, $msg ) = $self-Ticket-AddCustomFieldValue(
   Field = $CFName,
  Value = $DefaultValue,
  RecordTransaction = 1 );
   }

 Subject: Auto-Close Warning: {$Ticket-Subject}

I think your issue is after the 'unless' where you're calling Ticket on $self. 
In templates the ticket object is available as just $Ticket as in the Subject 
line above. Try switching your $self-Ticket to $Ticket anywhere you're calling 
$self in the template.

More docs on templates are available here:

http://bestpractical.com/docs/rt/latest/customizing/templates.html

You'll also need to put that initial code in some curly