[rt-users] RT4 Install on Centos7+Internal Server Error

2016-05-09 Thread Chris Herrmann
You need to fix permissions on 
/opt/rt4/var/log/rt.log

There may be other problems, but you won't see what they are presumably until 
they can be logged in there. 


Regards,
--
Chris Herrmann
Far Edge
http://www.faredge.com.au-
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Washington DC - May 23 & 24, 2016


[rt-users] Find the first day of this month

2015-12-08 Thread Chris Herrmann
Hi all,

This has been kicked around a few times over the years if google & the list
archives are anything to go on, but I haven't actually seen a solution that
meets what any of the requestors (and me) want.

Which is... to run a search using a date like:

Queue = 'myqueue' and (  ( Status = 'open' or Status = 'new' ) OR (
Resolved > 'first dow after last month' ) )


or "last month + 1" or "first dom" or really anything that will
programmatically always return the first day of this month. I have a shell
script that does this by constructing a date in bash, and then passing the
date to the query as a variable, but I can't do this within the "save
search" function.


The reason I'm after "save search" is that the HTML reports are easier for
humans to read than the TSV extracts that the bash scripts generate.


things like "last month" get close - but it simply works out "now - 30
days". And I can't see a way in Time::ParseDate to extract the month and
year in the same way I would in bash using something like `date +%b`


MIT have a nice page that has better examples than the Time::Parse doco
http://kb.mit.edu/confluence/pages/viewpage.action?pageId=4269222  but I
can't work out how to construct the thing I want using what's available.


Please tell me I'm wrong!


Regards,


Chris


Re: [rt-users] Find the first day of this month

2015-12-08 Thread Chris Herrmann
I also looked at the Attributes table, but the actual SavedSearch is stored
as a binary blob AFAICT? I was going to head down the path of updating the
contents of the field with a programmatically generated string once a day
or something like that:

queue = "myqueue" and Created > "2015-12-01"

i.e. just change the date in question every day so that the Dashboards and
scheduled email reports always have the desired dates. But... I can't see
how to do it with what's there... (a BLOB). And it looks really blobby too
- proper blob... not just a bunch of TEXT that happens to be stored as a
BLOB?

On 8 December 2015 at 21:55, Chris Herrmann <chrisherrma...@gmail.com>
wrote:

> Hi all,
>
> This has been kicked around a few times over the years if google & the
> list archives are anything to go on, but I haven't actually seen a solution
> that meets what any of the requestors (and me) want.
>
> Which is... to run a search using a date like:
>
> Queue = 'myqueue' and (  ( Status = 'open' or Status = 'new' ) OR (
> Resolved > 'first dow after last month' ) )
>
>
> or "last month + 1" or "first dom" or really anything that will
> programmatically always return the first day of this month. I have a shell
> script that does this by constructing a date in bash, and then passing the
> date to the query as a variable, but I can't do this within the "save
> search" function.
>
>
> The reason I'm after "save search" is that the HTML reports are easier for
> humans to read than the TSV extracts that the bash scripts generate.
>
>
> things like "last month" get close - but it simply works out "now - 30
> days". And I can't see a way in Time::ParseDate to extract the month and
> year in the same way I would in bash using something like `date +%b`
>
>
> MIT have a nice page that has better examples than the Time::Parse doco
> http://kb.mit.edu/confluence/pages/viewpage.action?pageId=4269222  but I
> can't work out how to construct the thing I want using what's available.
>
>
> Please tell me I'm wrong!
>
>
> Regards,
>
>
> Chris
>


[rt-users] RT unusably slow on iPhone / TLS

2015-11-25 Thread Chris Herrmann
hi all,

I'm really not sure where to start troubleshooting this. If I use a
computer to access our RT instance, then the speed is good. If I use any
iPhone, then the speed is terrible. 6S/5S/4S iOS7/8/9 - all terrible. By
terrible - I mean that the front page might take 10 seconds to load. If I
tap the username field, it might take a further 10 seconds before I can
enter text. Each and every tap / submit / etc is unusably slow. The key is
a 2048 RSA which should be OK on an iphone.

It *feels* like a site that's using horrible javascript, making the browser
unresponsive. But on an iPhone I really have no way of testing this (well
that I'm aware of).

We're running it on nginx, TLS, self signed cert - signed by an internal CA
that is trusted by the phone. I've tried things ranging from spdy (html/2
not supported on iphone), loading the pem with all of the certs in the
chain, enabling caching of static objects - no difference.

Just to be clear - it's fast on a regular PC / browser. Just slow on phones
(mobile & regular interface) - slow regardless of location (i.e. wifi in
the office to the server, 4G... no difference).

any ideas where I should look? or what do i need to tell you... to try and
get help?

Thanks!

Chris


Re: [rt-users] RT unusably slow on iPhone / TLS

2015-11-25 Thread Chris Herrmann
Poor form to reply to your own question... just tried Chrome on iOS - much
faster. Firefox refuses to load completely because it's a self signed cert.

On 25 November 2015 at 20:31, Chris Herrmann <chrisherrma...@gmail.com>
wrote:

> hi all,
>
> I'm really not sure where to start troubleshooting this. If I use a
> computer to access our RT instance, then the speed is good. If I use any
> iPhone, then the speed is terrible. 6S/5S/4S iOS7/8/9 - all terrible. By
> terrible - I mean that the front page might take 10 seconds to load. If I
> tap the username field, it might take a further 10 seconds before I can
> enter text. Each and every tap / submit / etc is unusably slow. The key is
> a 2048 RSA which should be OK on an iphone.
>
> It *feels* like a site that's using horrible javascript, making the
> browser unresponsive. But on an iPhone I really have no way of testing this
> (well that I'm aware of).
>
> We're running it on nginx, TLS, self signed cert - signed by an internal
> CA that is trusted by the phone. I've tried things ranging from spdy
> (html/2 not supported on iphone), loading the pem with all of the certs in
> the chain, enabling caching of static objects - no difference.
>
> Just to be clear - it's fast on a regular PC / browser. Just slow on
> phones (mobile & regular interface) - slow regardless of location (i.e.
> wifi in the office to the server, 4G... no difference).
>
> any ideas where I should look? or what do i need to tell you... to try and
> get help?
>
> Thanks!
>
> Chris
>


[rt-users] using date calcs in reports

2015-07-05 Thread Chris Herrmann
Hi all,

I can currently export a list of tickets with most of the data I need like
this:

rt list queue = 'myqueue' and (  ( Status = 'open' or Status = 'new') OR
(  Resolved  '$startdate' ) ) -f
id,subject,status,timeworked,requestors,created,started,
lastupdated,resolved  /tmp/report.tsv

Now... what I'd like to do is calculate the difference between Created 
Started... I'm pretty sure that Date::Calc  -  Delta_DHMS will give me what
I want... but I'm not sure how to use this in the query above. Is that even
possible?

I know that there's an RT::Extension::SLA extension which I will also play
with in case it exposes some additional fields that give me the info I want
automagically... but figured I'd ask in case there is an easy way of using
this bit of perl to put the value I want into the output file in one step.

Thanks!

Chris


[rt-users] rt-crontool escalation

2015-02-22 Thread Chris Herrmann
Hi all,

I almost have rt-crontool escalation doing what I want, using the following
command:

rt-crontool --search RT::Search::FromSQL --search-arg 'Status = open or
Status = new' --action RT::Action::EscalatePriority --verbose --log info

I've used this rather than:

--search RT::Search::ActiveTicketsInQueue  --search-arg general

because you then need to pass in every single queue that you want it to
iterate over (in my case every queue).

Anyway - the escalation part is working - it's correctly increasing the
priority by the desired amounts. But... an unintended (but logical) side
effect of this is that when you look at a list of new / open tickets, the
Last Updated and Last Updated By are now of course the last time that
the escalation script was run, and the rtuser configured to run it.

The problem with this, is that it obscures what we actually want to see in
these lists - which is when did a human being last touch this ticket, and
who was it?.

So... is there either a way to modify the search results so that it shows
this, OR is there a way to modify rt-crontool so that it doesn't impact
these specific values for standard searches / ticket lists etc?

Thankyou!

Chris


Re: [rt-users] rt-crontool escalation

2015-02-22 Thread Chris Herrmann
Poor form, I know... but I think I might have found the answer:

rt-crontool --search RT::Search::FromSQL --search-arg 'Status = open or
Status = new' --action RT::Action::LinearEscalate --action-arg
UpdateLastUpdated: 0 --verbose --log info
https://www.bestpractical.com/docs/rt/latest/RT/Action/LinearEscalate.html

Now I just need to work out how to display the priority numerically in the
GUI so I can verify that it's working! BRB... :)

On 23 February 2015 at 17:13, Chris Herrmann chrisherrma...@gmail.com
wrote:

 Hi all,

 I almost have rt-crontool escalation doing what I want, using the
 following command:

 rt-crontool --search RT::Search::FromSQL --search-arg 'Status = open or
 Status = new' --action RT::Action::EscalatePriority --verbose --log info

 I've used this rather than:

 --search RT::Search::ActiveTicketsInQueue  --search-arg general

 because you then need to pass in every single queue that you want it to
 iterate over (in my case every queue).

 Anyway - the escalation part is working - it's correctly increasing the
 priority by the desired amounts. But... an unintended (but logical) side
 effect of this is that when you look at a list of new / open tickets, the
 Last Updated and Last Updated By are now of course the last time that
 the escalation script was run, and the rtuser configured to run it.

 The problem with this, is that it obscures what we actually want to see in
 these lists - which is when did a human being last touch this ticket, and
 who was it?.

 So... is there either a way to modify the search results so that it shows
 this, OR is there a way to modify rt-crontool so that it doesn't impact
 these specific values for standard searches / ticket lists etc?

 Thankyou!

 Chris



Re: [rt-users] rt-crontool escalation

2015-02-22 Thread Chris Herrmann
Hmm...

rt list -f id,priority doesn't show the priority changing (from the CLI) -
is there another way I can verify if it's actually working or if not... why
not?


[rt-users] Duplicate ticket detection at OnCreate

2015-01-19 Thread Chris Herrmann
Hi all,

we have many systems that generate emails on conditions (success, fail,
warn etc), and many of these will quite vocally notify you when something
goes wrong. So if you have 100 systems all emailing you every 5 minutes
about the same underlying problem... the queue rapidly gets out of control.

Are there any extensions / plugins / scrips etc that can be used to look
for duplicate tickets on creation? I know there's a Nagios plugin - but
these aren't Nagios tickets so you don't have a system changing state. In
this case the emails all have identical subject tags (like SUBJECT: Warning
backup failure on host(x)); occur within a short time interval but because
they're generated from a remote system none of them have an RT tag like
[myrtsystem #12345].

We currently manage it when it occurs by running the following:

rt list queue = 'myqueue' and status = 'new' and subject='My Broken
Ticket Subject' -i | rt edit - set status='deleted'

which works well (much faster than the webgui) but it would be nice if we
could simply delete them on incoming or merge them or something like that.

Thanks!

Chris


Re: [rt-users] Continued Migrations Questions

2014-12-13 Thread Chris Herrmann
Hi,

You're after a branded queue. Sorry don't have the doco to hand, but hopefully 
searching for that term will help. 

Regards,
--
Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

[rt-users] rt-users] Continued Migrations Questions -

2014-10-22 Thread Chris Herrmann
Hi Matt,

Yes you can do this on a per queue basis. My term for this is per queue
branding - I'm not sure if there's an official term for it. A disclaimer -
there are probably better / more efficient ways of doing this; I'm not an
expert but this is how we have it working.

So in a nutshell...

- Make sure the MTA will deliver messages for the desired addresses (e.g.
mynewqu...@mynewdomain.com -- mynewqueue ). In our case we have a forward
facing MTA, so it goes:

  mynewqu...@mynewdomain.com -- mynewqueuealias@myrthost --
rt-mailgate

- Create your queue, put in the email addresses as you normally would for
your standard RT queue
- then create queue specific templates to override the system wide ones.
For example:

Template Name: Autoreply
Template Content:
Sender: mynewqu...@mynewdomain.com
Reply-To: mynewqu...@mynewdomain.com
From: My New Queue mynewqu...@mynewdomain.com
Subject: My New Queue Support Case: {$Ticket-Subject}
RT-Attach-Message: yes

{$Transaction-Content()}

This means that the queue will send out replies with these values, instead
of the system wide defaults (which would normally pick up your queue
address for correspondence). You need the queue address so that things
actually work - for example so that mailgate can drop the tickets in the
queue.

Hopefully that makes sense and I haven't made too many egregious errors...

Cheers,

Chris
-- 
RT Training November 4  5 Los Angeles
http://bestpractical.com/training


[rt-users] t-users] File attachments corrupted after DB migration

2014-05-17 Thread Chris Herrmann
Hi Matthias,

I would guess that it might be the max packet size in your my.ini - look for 
the setting in the [mysqldump] section, and make sure it's suitably large. If 
you have fields larger  than this value then it will truncate the field when 
exporting.  I'm not sure if there's a corresponding setting in pg that you will 
need to tweak. 

Regards,
--
Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training

[rt-users] From Inbox to Ticket

2014-05-09 Thread Chris Herrmann
Hi, just take regular backups of your SQL server. If mail fails the sending 
party should retry. If your system is down for longer than the mail retry limit 
a) the sender will be notified by their mail server and b) presumably you will 
notice if your server is down for 5 days. 

One thing to watch out for that I have encountered previously is if the rt 
thread handling the incoming message runs out of memory and dies you will lose 
the message... But if my memory serves me right we saw this only on outbound 
correspondence (ie a ticket reply from rt to the requester), not inbound. 

Regards,
--
Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au-- 
RT Training - Dallas May 20-21
http://bestpractical.com/training

Re: [rt-users] trying to calculate time worked per transaction / ticket using SQL

2013-12-03 Thread Chris Herrmann
Hi Tom,

Thanks for your reply. A couple of reasons why I've started this way -
primarily probably familiarity. But also:

- Speed - database access is significantly faster than REST
- I can run queries against a replica of the database, thereby not
interfering with the production system
- It fits better with how we access and aggregate data from other systems
(i.e. SQL is the only common language that they all share)
- We already have several systems pulling data from RT via SQL since 2002
- My SQL skills are significantly better than my (non-existent) Perl skills
so trying to access data as data makes more sense to me - I've been stymied
before by Perl when trying to query using RTs built-in query engine for
example. I don't know but I would guess that REST will also use perl syntax
for querying?

If using REST is it possible to make use of query caches etc? I realise
that under the hood the sql engine will still have it's own indexes /
query caches / etc, but curious if REST also has any of this?

Regards,

Chris


On 3 December 2013 11:07, Tom Lahti tla...@dmsolutions.com wrote:

  Why don’t use you want to use REST?  You’re shooting yourself in the
 foot; when you upgrade RT, your queries will no longer work and will have
 to be updated.  If you use the REST interface, you can upgrade with
 impunity and not have to worry about your queries not working anymore.

  —
 Tom

  On Dec 1, 2013, at 11:18 PM, Chris Herrmann chrisherrma...@gmail.com
 wrote:

   Hi all,

  Just bumping this one - does anyone have any suggestions? Am I
 approaching this the wrong way? Using MySQL btw if that makes a difference.

  Thanks,

  Chris

 -- Forwarded message --
 From: Chris Herrmann chrisherrma...@gmail.com
 Date: 24 November 2013 22:11
 Subject: trying to calculate time worked per transaction / ticket using SQL
 To: rt-users@lists.bestpractical.com


   Hi all,

 I'm trying to put together a SQL query to present a view, that allows
 summaries of data to be performed in reporting tools. I have a feeling that
 this question has been asked before and answered, but my google-fu is
 failing me, so apologies in advance... I've only found questions about
 using RT-REST, for example (which I don't want to do).

  I'm using RT 3.8.7 (yes I know it's old and it's in the pipeline to
 upgrade but we have a bunch of other systems that are integrated with RT
 and so it's not a simple just upgrade RT project for us.

 Anyway, what I want to end up with is the following fields:

  Tickets.EffectiveID
 Queues.Name
  Tickets.Owner
  Transactions.Creator
  Transactions.TimeTaken
  Transactions.Created
  Tickets.Status
  Tickets.Started
  Tickets.Resolved
  Tickets.Created
  Transactions.Type

  So i can easily point various reports at it and work from there.

  the sql I'm using is...
 SELECT
 Tickets.EffectiveId AS TicketID,
 Queues.`Name` AS Queue,
 Tickets.`Owner` AS OwnerID,
 Transactions.Creator AS TransactionCreatorID,
 Transactions.TimeTaken AS TimeTaken,
 Transactions.Created AS TransactionCreated,
 Tickets.`Status` AS TicketStatus,
 Tickets.Started AS TicketStarted,
 Tickets.Resolved AS TicketResolved,
 Tickets.Created AS TicketCreated,
 Transactions.Type AS TransactionType
 FROM
 Tickets
 JOIN Transactions ON ((Transactions.ObjectId = Tickets.id)))
 JOIN Queues ON ((Queues.id = Tickets.Queue)

  but I'm not getting the results I expect...

  or even something far simpler like:
 SELECT
 Transactions.Creator,
 sum(Transactions.TimeTaken/60) AS TimeInHours,
 Month(Transactions.Created) AS TransactionMonth,
 Year(Transactions.Created) AS TransactionYear
 FROM
 Tickets JOIN Transactions ON Transactions.ObjectId = Tickets.id
 where Transactions.Created  2013-10-01
 group by Creator, Month(Transactions.Created), Year(Transactions.Created)

  just to try and compare the numbers... that I'm seeing with
 timeworked.pl...

  Now my problem is that the numbers I'm getting don't match those
 returned by REST - for example using the timeworked.pl script..

  Is there a definitive SQL somewhere that I should use to return
 these?... and any pointers on what transaction types I should be avoiding
 or how to avoid double counting merged transactions I would be very
 grateful...

  Thankyou!

  Chris




 This e-mail message is confidential and is intended solely for the use of
 the addressee(s) named above. If you are not the intended recipient, or the
 person responsible to deliver it to the recipient, you are hereby advised
 that any dissemination, distribution or copying of this communication is
 prohibited. If you have received this e-mail in error, please notify the
 sender by return e-mail. Thank you.



[rt-users] Fwd: trying to calculate time worked per transaction / ticket using SQL

2013-12-01 Thread Chris Herrmann
Hi all,

Just bumping this one - does anyone have any suggestions? Am I approaching
this the wrong way? Using MySQL btw if that makes a difference.

Thanks,

Chris

-- Forwarded message --
From: Chris Herrmann chrisherrma...@gmail.com
Date: 24 November 2013 22:11
Subject: trying to calculate time worked per transaction / ticket using SQL
To: rt-users@lists.bestpractical.com


Hi all,

I'm trying to put together a SQL query to present a view, that allows
summaries of data to be performed in reporting tools. I have a feeling that
this question has been asked before and answered, but my google-fu is
failing me, so apologies in advance... I've only found questions about
using RT-REST, for example (which I don't want to do).

I'm using RT 3.8.7 (yes I know it's old and it's in the pipeline to upgrade
but we have a bunch of other systems that are integrated with RT and so
it's not a simple just upgrade RT project for us.

Anyway, what I want to end up with is the following fields:

Tickets.EffectiveID
Queues.Name
Tickets.Owner
Transactions.Creator
Transactions.TimeTaken
Transactions.Created
Tickets.Status
Tickets.Started
Tickets.Resolved
Tickets.Created
Transactions.Type

So i can easily point various reports at it and work from there.

the sql I'm using is...
SELECT
Tickets.EffectiveId AS TicketID,
Queues.`Name` AS Queue,
Tickets.`Owner` AS OwnerID,
Transactions.Creator AS TransactionCreatorID,
Transactions.TimeTaken AS TimeTaken,
Transactions.Created AS TransactionCreated,
Tickets.`Status` AS TicketStatus,
Tickets.Started AS TicketStarted,
Tickets.Resolved AS TicketResolved,
Tickets.Created AS TicketCreated,
Transactions.Type AS TransactionType
FROM
Tickets
JOIN Transactions ON ((Transactions.ObjectId = Tickets.id)))
JOIN Queues ON ((Queues.id = Tickets.Queue)

but I'm not getting the results I expect...

or even something far simpler like:
SELECT
Transactions.Creator,
sum(Transactions.TimeTaken/60) AS TimeInHours,
Month(Transactions.Created) AS TransactionMonth,
Year(Transactions.Created) AS TransactionYear
FROM
Tickets JOIN Transactions ON Transactions.ObjectId = Tickets.id
where Transactions.Created  2013-10-01
group by Creator, Month(Transactions.Created), Year(Transactions.Created)

just to try and compare the numbers... that I'm seeing with timeworked.pl...

Now my problem is that the numbers I'm getting don't match those returned
by REST - for example using the timeworked.pl script..

Is there a definitive SQL somewhere that I should use to return these?...
and any pointers on what transaction types I should be avoiding or how to
avoid double counting merged transactions I would be very grateful...

Thankyou!

Chris


[rt-users] trying to calculate time worked per transaction / ticket using SQL

2013-11-24 Thread Chris Herrmann
Hi all,

I'm trying to put together a SQL query to present a view, that allows
summaries of data to be performed in reporting tools. I have a feeling that
this question has been asked before and answered, but my google-fu is
failing me, so apologies in advance... I've only found questions about
using RT-REST, for example (which I don't want to do).

I'm using RT 3.8.7 (yes I know it's old and it's in the pipeline to upgrade
but we have a bunch of other systems that are integrated with RT and so
it's not a simple just upgrade RT project for us.

Anyway, what I want to end up with is the following fields:

Tickets.EffectiveID
Queues.Name
Tickets.Owner
Transactions.Creator
Transactions.TimeTaken
Transactions.Created
Tickets.Status
Tickets.Started
Tickets.Resolved
Tickets.Created
Transactions.Type

So i can easily point various reports at it and work from there.

the sql I'm using is...
SELECT
Tickets.EffectiveId AS TicketID,
Queues.`Name` AS Queue,
Tickets.`Owner` AS OwnerID,
Transactions.Creator AS TransactionCreatorID,
Transactions.TimeTaken AS TimeTaken,
Transactions.Created AS TransactionCreated,
Tickets.`Status` AS TicketStatus,
Tickets.Started AS TicketStarted,
Tickets.Resolved AS TicketResolved,
Tickets.Created AS TicketCreated,
Transactions.Type AS TransactionType
FROM
Tickets
JOIN Transactions ON ((Transactions.ObjectId = Tickets.id)))
JOIN Queues ON ((Queues.id = Tickets.Queue)

but I'm not getting the results I expect...

or even something far simpler like:
SELECT
Transactions.Creator,
sum(Transactions.TimeTaken/60) AS TimeInHours,
Month(Transactions.Created) AS TransactionMonth,
Year(Transactions.Created) AS TransactionYear
FROM
Tickets JOIN Transactions ON Transactions.ObjectId = Tickets.id
where Transactions.Created  2013-10-01
group by Creator, Month(Transactions.Created), Year(Transactions.Created)

just to try and compare the numbers... that I'm seeing with timeworked.pl...

Now my problem is that the numbers I'm getting don't match those returned
by REST - for example using the timeworked.pl script..

Is there a definitive SQL somewhere that I should use to return these?...
and any pointers on what transaction types I should be avoiding or how to
avoid double counting merged transactions I would be very grateful...

Thankyou!

Chris


[rt-users] Fwd: Some issues with message box after upgrade to 4.0.7

2013-10-16 Thread Chris Herrmann


Hi, this doesn't address the underlying question of how to change the MSG box, 
but if you're using Firefox you can use the Lazarus plugin to raise your text 
from the dead in the scenario you describe. You need to toggle the box into 
plain text mode to get the right-click Lazarus restore option. After this you 
can toggle it back to HTML if you want. This toggle is one of the buttons on 
the wysiwyg Comment box control sorry can't remember which one right now!


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

[rt-users] nginx / varnish / apache with RT?

2013-08-06 Thread Chris Herrmann
Hi all,

i've been playing with an NVA setup for some lamp sites (Joomla) and the
scaling is looking pretty amazing... still early days but initial results
look very promising.

anyway, it got me thinking to whether varnish would work with RT. I'm
familiar enough with it to understand the generic accelerator principle ...
but I don't see how it would work with generated content - because of RT
handles sessions / authentication / etc. Or is it smart enough to know that
if I visit the same ticket twice in a row and the ticket hasn't changed, to
give me cached content?

I've tried searching for perl varnish and request tracker varnish type
pages but have only found one archive thread
http://www.gossamer-threads.com/lists/rt/users/72455 which appears
inconclusive - does it actually make a noticeable difference or not?
Internally we're using a squid proxy, and we have a small number of users,
so not sure that the static page elements being handled by varnish or nginx
would offer a huge advantage? anyway keen to hear people's experiences or
other thoughts on accelerating RT...

Cheers,

Chris


Re: [rt-users] rt-users Digest, Vol 113, Issue 9

2013-08-05 Thread Chris Herrmann
Hi Kevin,

Thanks for that, yes I'm a bit blonde undef would not log. I've changed
that to 'error' now.

OK, there's 3 tickets with that effectiveID; there are 91 transactions that
relate to those three ticket IDs. OK i've just tried the cli, and

show ticket/106648/history

works OK... and the www interface is working OK right now too for that
ticket. Hmm...

What kind of information do I need to dig out for you?

Sorry a bit vague I know, I'm just not sure where to look for the
information that's going to give a clue about what broke!

so the logs when it does work look the same as when it fails:
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: last message repeated 2 times
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: last message repeated 2 times
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:02 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:12 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:12 sirius RT: last message repeated 35 times
Aug  6 09:53:12 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:12 sirius RT: last message repeated 44 times
Aug  6 09:53:12 sirius RT: We found a merged ticket.106966/106648
Aug  6 09:53:12 sirius RT: We found a merged ticket.106969/106648
Aug  6 09:53:12 sirius RT: last message repeated 11 times
Aug  6 09:53:12 sirius RT: We found a merged ticket.106966/106648

If I comment right now I get in /var/log/user.log:

Aug  6 09:55:07 sirius RT: About to think about scrips for transaction
#971499
Aug  6 09:55:07 sirius RT: About to prepare scrips for transaction #971499
Aug  6 09:55:07 sirius RT: Found 7 scrips for TransactionCreate stage with
applicable type(s) Comment
Aug  6 09:55:07 sirius RT: About to commit scrips for transaction #971499
Aug  6 09:55:07 sirius RT: Committing scrip #7 on txn #971499 of ticket
#106648
Aug  6 09:55:07 sirius RT: Calling SetRecipientDigests for transaction
RT::Transaction=HASH(0x7f5fbc933c10), id 971499
Aug  6 09:55:07 sirius RT: Working on mailfield To; recipients are
Aug  6 09:55:07 sirius RT: Subject: [myRT #106648] [Comment] B/F - Broken
site#012From: Chris Herrmann via RT helpdesk-comment@sirius#012Reply-To:
helpdesk-comment@sirius#012In-Reply-To:
CCD0821AE781994EB8BAB510676B5EF50120CD129B79@mail.local#012References:
RT-Ticket-106648@local#012
CCD0821AE781994EB8BAB510676B5EF50120CD129B79@mail.local#012Message-ID:
rt-3.8.7-31323-1375746907-921.106648-7-0@local#012Precedence:
bulk#012X-RT-Loop-Prevention: myRT#012RT-Ticket: myRT
#106648#012Managed-BY: RT 3.8.7 (
http://www.bestpractical.com/rt/)#012RT-Originator:
chris@local#012MIME-Version:
1.0#012Content-Transfer-Encoding: 8bit#012Content-Type: text/plain;
charset=utf-8#012X-RT-Original-Encoding: utf-8
Aug  6 09:55:07 sirius RT: Removing deferred recipients from To: line
Aug  6 09:55:07 sirius RT: Setting deferred recipients for attribute
creation
Aug  6 09:55:07 sirius RT: Working on mailfield Cc; recipients are

(and more like this - truncating in the interests of brevity - let me know
if you want a full dump but it looks like it's just iterating over several
scrips determining who it needs to notify based upon the transaction).

Aug  6 09:55:08 sirius RT: Committing scrip #26 on txn #971499 of ticket
#106648
Aug  6 09:55:08 sirius RT: Committing scrip #29 on txn #971499 of ticket
#106648
Aug  6 09:55:08 sirius RT: Found 0 scrips for TransactionBatch stage with
applicable type(s) Comment
Aug  6 09:55:09 sirius RT: We found a merged ticket.106966/106648

Let me know where else I should go digging, or more general info that I can
/ should provide you on our setup.

Thanks again!

Chris


[rt-users] One particular ticket crashes RT 3.8.7

2013-08-04 Thread Chris Herrmann
Hi guys,

at this stage I'm just hoping to find out where to look, to get more
information. Scenario is:
- Viewing or comment / replying on a specific ticket causes the page to
fail. Other tickets are fine.
- Viewing the same ticket via the mobile interface is OK
- Emailing the ticket wtih updated comments is OK
- I haven't tried CLI yet so can't comment
- Upgrading RT isn't an option right now
- It isn't consistent - it doesn't always fail. Fail rate appears to be
around 9/10 times

The only logs of note that I can find are:
apache vhost access_log - just shows me that the page got hit e.g.
  /Ticket/Update.html?Action=Commentid=106648
 /Ticket/Display.html?id=106648
apache vhost error_log - empty
apache default error log - has:
[Mon Aug 05 12:58:24 2013] [notice] child pid 7013 exit signal Segmentation
faul

these correspond to when i try to view this specific ticket.
Based upon some list emails I saw kicking around last week I've added:
Set($LogToSyslog, 'debug');
Set($LogToScreen, 'error');
Set($LogToFile  , undef);
Set($LogDir, '/var/log/rt3');
Set($LogToFileNamed , rt3.log);#log to rt.log

to RT_SiteConfig.pm
but... there's nothing logging to /var/log/rt3
/var/log/debug contains:
Aug  5 13:45:59 sirius RT: We found a merged ticket.106966/106648
Aug  5 13:45:59 sirius RT: We found a merged ticket.106969/106648
Aug  5 13:46:02 sirius RT: We found a merged ticket.106966/106648
Aug  5 13:46:02 sirius RT: last message repeated 35 times
Aug  5 13:46:02 sirius RT: We found a merged ticket.106969/106648
Aug  5 13:46:02 sirius RT: last message repeated 44 times
Aug  5 13:46:02 sirius RT: We found a merged ticket.106966/106648
Aug  5 13:46:02 sirius RT: We found a merged ticket.106969/106648
Aug  5 13:46:02 sirius RT: last message repeated 11 times
Aug  5 13:46:02 sirius RT: We found a merged ticket.106966/106648
/var/log/syslog (ditto)
/var/log/user.log
 even more of it...
Aug  5 13:46:02 sirius RT: We found a merged ticket.106966/106648
Aug  5 13:46:21 sirius RT: last message repeated 42 times



Other notes:
- hitting the page chews a lot of CPU for a long time before finally dieing
- the ticket is large (a lot of text) but it's by no means the largest
ticket we have by an order of magnitude. These other larger tickets are
fine...

Help! Not sure where I should be looking... Thanks!

Regards,

Chris


[rt-users] Message autosave

2013-05-29 Thread Chris Herrmann
Firefox extension Lazarus does this in all sites. 

Regular bacon saver. 


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


[rt-users] Database mangling 1mb

2013-05-28 Thread Chris Herrmann
Hi my guess would be max allowed packet size (my.cnf) is being exceeded. If 
MySQL receives an oversized field it will truncate to the specified limit. This 
will break binary files. 

Make sure your:

Regular web access has a large enough max allowed packet;
That your backups match this value;
That any restore scripts / procedures also match this value. 


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


[rt-users] Kanban / agile workflows?

2013-05-23 Thread Chris Herrmann
Hi guys,

Just wondering if there are any plugins or ?? That would facilitate alternative 
ways of visualising work to do like agile or kanban or ??

I'm thinking this could be helpful for teams and individual users to prioritise 
their work. 

Thanks,


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


Re: [rt-users] Kanban / agile workflows?

2013-05-23 Thread Chris Herrmann

Just realise this is almost exactly the question I asked several weeks ago but 
had no responses...

Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

On 23/05/2013, at 20:17, Chris Herrmann chrisherrma...@gmail.com wrote:

Hi guys,

Just wondering if there are any plugins or ?? That would facilitate alternative 
ways of visualising work to do like agile or kanban or ??

I'm thinking this could be helpful for teams and individual users to prioritise 
their work. 

Thanks,


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


-- 
RT Training in Seattle, June 19-20: http://bestpractical.com/training


[rt-users] Agile / Scrum workflows

2013-05-01 Thread Chris Herrmann
Hi all,

I'm wondering if there are any plugins / mods / etc that would allow
tickets to be viewed in an Agile / et al type style - in the same way that
GreenHopper does this for Jira. In fact if I could somehow get RT tickets
to talk to Greenhopper that might actually do...

Searching for RT  Agile / Greenhopper / jira / etc just returns results on
migrating, or articles comparing the two - but so far I haven't found
anyone talking about whether it would be possible to make them talk at all.

Why do we have both?

We use Jira for software development - it's tied to the version control
repository, and we build workflows that suit the style of project. And
request tracker for helpdesk tickets. But... it would be very nice if there
was a way to link the two in some way.

Cheers,

Chris


[rt-users] Could someone help a newb evaluating RT with email setup?

2013-02-19 Thread Chris Herrmann
We use Exchange 2007 - RT, setup should be the same in 2010.

- We're using exim because it can be configured to accept emails on a
per queue basis. Exim config looks like:

=
router/310_rt
---
request_tracker3:
  debug_print = R: request_tracker3 for \
$local_part$local_part_suffix@$domain \
(calling ${substr_1:${if eq{$local_part_suffix}{}\
   {-correspond}\
   {$local_part_suffix}}})
  driver = redirect
  domains = +rt3_domains
  local_parts = mysql; QUEUENAME_QUERY
  local_part_suffix = -comment
  local_part_suffix_optional
  pipe_transport = request_tracker3_pipe
  data = |/usr/bin/rt-mailgate \
   --queue \${lookup mysql{QUEUENAME_QUERY}}\ \
   --action ${substr_1:${if eq{$local_part_suffix}{}\
{-correspond}\
{$local_part_suffix}}} \
   --url RT3_URL
  user = www-data

==
transport/30-rt:
-
request_tracker3_pipe:
  debug_print = T: request_tracker3_pipe for $local_part@$domain
  driver = pipe
  return_fail_output
  allow_commands = /usr/bin/rt-mailgate

=
main/10_rt

QUEUENAME_QUERY   = \
SELECT Name FROM Queues WHERE \
CorrespondAddress =
'${quote_mysql:$local_part}@${quote_mysql:$domain}' \
AND Disabled = '0'

hide mysql_servers = {mysqlserver}/{rtdb}/{rtuser}/{rtpass}

domainlist rt3_domains = myrtserver.mydomain.com: mydomain.com :
helpdesk.mydomain.com : otherdomainhandledbyrt.com

RT3_URL = https://myrt.mydomain.com/
-

(we're using RT3.8 series still, hopefully someone can fill in if this
setup still works in RT4)


- In Exchange you configure a contact as
myrtqu...@myrthost.mydomain.com. So if someone then emails
myrtqu...@mydomain.com it will be correctly forwarded to the RT
host. Exim will then pick it up, and inject it into the correct queue
via rt-mailgate.
- You should configure the default email address in Exchange to be
myrtqu...@mydomain.com and not myrtqu...@myrthost.mydomain.com
- You obviously need to create the queue in RT, and configure the
email addresses for the queue to match those specified in Exchange
- You need to allow inbound SMTP to your RT host from Exchange and
allow RT to use Exchange as a smarthost out

Let me know how you go,

Regards,

Chris


-- 
RT training in Amsterdam, March 20-21: 
http://bestpractical.com/services/training.html

Help improve RT by taking our user survey: 
https://www.surveymonkey.com/s/N23JW9T


[rt-users] Vote for feature workflow

2012-11-22 Thread Chris Herrmann
Hi guys,

Apologies if this is documented somewhere... but has anyone
implemented a +1 Like Vote type workflow in RT? Basically I
would like a way of trying to get feedback from users on how important
they thing different things are (using it for a bug tracking system)
and prioritising the ones that they vote for.

Or is there a plugin / extension / etc that can be used for this? I've
had a google and found some references to something called
vote-sidebar back in 2009, but can't find a matching extension
anywhere...

We're currently running 3.8 series but would consider upgrading if
this turned out to be a 4.x only type of thing...

Thanks!

Chris

We're hiring! http://bestpractical.com/jobs


[rt-users] Exchange rt

2012-11-07 Thread Chris Herrmann
Setup a contact for your desired queue email address - for example:

myqu...@mydomain.com 

And the contact delivers to:

myqu...@myrtserver.mydomain.com

Similarly configure a comment address:

myqueue-comm...@mydomain.com

-- myqueue-comm...@myrtserver.mydomain.com

Set the primary domain as the primary address eg myqu...@mydomain.com

Configure the queues to the rtserver.mydomain.com addresses. 

Smart host rt via exchange to send emails out. 

Regards,


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

We're hiring! http://bestpractical.com/jobs


[rt-users] Spreadsheet esq

2012-11-05 Thread Chris Herrmann
How about using rtfm and creating an article? I'm not sure if it's possible to 
put HTML into the template article however (have never tried). 

That might get you an HTML table with headings at least?

We're hiring! http://bestpractical.com/jobs


[rt-users] Apache taking up too much CPU

2012-10-26 Thread Chris Herrmann
Try dropping the number of worker threads that apache is running. If it runs 
out of memory you'll see things like mail gate failing to send emails. On our 
system we had to trim this down (sorry I can't remember the exact apache2.conf 
settings im on my phone) but the problem for us was that apache would sometimes 
try to allocate far more memory than the box had (far more than 613mb... But 
our system is also far busier). Dropping this number helped immediately and has 
been great ever since. 

You will possilbly also need to tune MySQL to use a limited memory footprint. 

Given the cost of memory its unusual to see a box with that little ram these 
days; rt (and indeed just apache / MySQL) will be far happier with more memory.

Let me know if you want me to dig up the exact parameters we changed and I'll 
look for them later tonight. 


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

We're hiring! http://bestpractical.com/jobs


[rt-users] summing time per queue

2012-10-17 Thread Chris Herrmann
Hi all,

Is it possible to use ticket sql to sum a list of tickets by queue?
I.e. is there an equivalent to the SQL SUM and Group by construct?

Thanks,

Chris


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] Customer and contact lists

2012-09-11 Thread Chris Herrmann
Hi Hans,

We use rt in this manner. Create a queue and group per customer; associate the 
users with the group, assign group perms to the queues and you're cooking with 
gas. 

Regards,


Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


Final RT training for 2012 in Atlanta, GA - October 23  24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] can RT support this type of workflow

2012-07-05 Thread Chris Herrmann
Hi all,

I'm currently considering RT for a client, but I'm not sure how to
implement the following type of workflow / scenario; any thoughts /
suggestions welcome (or if it's just flat out impossible or trying to
put a square peg in a round hole please tell me too). I'm very
familiar with RT3.8 series, but not 4 so not sure if some of these
things are easier to achieve in 4... (we would implement current
latest stable for them).

The client has several types of workflows. Most of these are based
around case management type workflows, and will work reasonably well
with an out of the box RT implementation. One case I can't work out
is:

- They want to store information about passes that have been issued to
customers for vendor X,Y,Z
- There are rules about how often, and how many passes may be issued
to a customer. For example a customer may not be issued more than 3
passes for vendor X in any 6 month period.
- They need to be able to report on how many passes have been issued:
to a customer; for vendor X

Maybe I could store this as custom fields, but I can only see custom
fields for queues and tickets. Maybe that's OK because a particular
transaction (real world transaction not RT transaction) would
involve entering the quantity of vouchers issued for Vendor X,Y,Z.
But... what type of custom field would be most appropriate for this?
And

The next thing is that we would need to rework the RT interface to
make it more customer centric rather than ticket centric. By this I
mean that when a case is opened the first thing they do is capture a
lot of information about the customer OR they are searching for a
customer by name, address etc etc. Looking at the dashboard I can't
see an easy way to do this - I think that we'd need to modify one or
several templates but I'm not sure where to start looking at for this,
so that the top panel for example was a search that returned RT users
and allowed them to modify the users, and then easily create a ticket
given a selected user.

Actually there are custom fields that are specific to a user and not
ticket or queue that we need, sorry just thought of some. If I look at
a user I can see a section for custom fields but no way of assigning
any...?

Thanks all,

Chris


[rt-users] Regex matching in scrips to match email requestor RT 3.8.7 - reference material anywhere?

2012-04-12 Thread Chris Herrmann
Hi all,

I'm trying to get a scrip setup that will send conditionally based
upon the senders email address. Basically I don't want to send an
email to addresses that look like:

root@
administrator@
mailer-daemon@

and so forth. I've looked at the doco both online and in the RT book
but neither cover these specific cases I'm trying to do - for example
the object model isn't completely documented and I can't find a page
that tells me what operators I can use with text or other fields.

So... I've actually got three questions here (sorry!):

1. How to regex these strings
2. What the object reference is to retrieve the first requestor email
address inside a scrip
3. Can I build an array of results so that I can keep adding more and
more cases easily

I've got a script that is correctly working that handles conditional
stuff OK for values of CF fields and ticket status, but I'm not sure
how to handle this one because I'm doing a fuzzy match... if it was
SQL it would be easy where email like 'root@%' or similar depending
on your DBMS. I know I can use eq or ne but is there a like
comparator available that I can use in a scrip... and if so, how do I
pass it a wildcard?

Question 1.
I've found some examples of scrips in wikia that skirt around what I'm
trying to do... (sorry to the OP I don't have the original link
available but I think it was the customcondition page):

   my $subject = $Transaction-Attachments-First-GetHeader('Subject');
   if ($subject =~ /\*\* RECOVERY (\w+) - (.*) OK \*\*/) {

but... how do I interpret this? I'm guessing that the syntax means
*RECOVERY*OK* (i.e. *== wildcard). But what's the (\w+) and why the
\*\*/ construction? I've seen some other examples out there with other
syntax too but don't have them at hand. Is there a page somewhere that
describes what's available for this and how to use the syntax?

Question 2.
I think that the object I need is:  $self-TicketObj-IsWatcher(Type
= 'Requestor', Email = 'f...@bar.com');
based upon another page on wikia (apologies again)!
but... it seems a little bit odd that I can't reference it by
$self-TicketObj-Requestor-Email?
Also, if I do reference it as above, then what happens if there is  1
Requestor? I would be happy if it only returns the email of the first
requestor, but would it does this or return the ARRAY error you see in
the CLI when trying to pull requestor email?

Question 3.
Apologies I haven't actually looked into this yet as I got stuck on 1
 2, but if there's an easy way to model a growing list of things to
match please point me at an example. Another use case for this would
be auto-deleting spam emails, and auto-resolving system generated
tickets that have no error content (for example Backup successful).

Thanks,

Chris


Re: [rt-users] RT3.8.7 using custom fields to restrict sending a reply on resolve

2012-03-05 Thread Chris Herrmann
Thanks Ken, I have it working now. I also found
http://wiki-archive.bestpractical.com/view/CustomConditionSnippets
which was very helpful - it actually has a specific example for what
I'm trying to do. I have a couple of questions too... but first the
answer:


Condition: UserDefined
Action: NotifyRequestors
Template: MyTemplate
Stage: TransactionCreate

Custom Condition:
my $Ticket = $self-TicketObj;

# We want the Request Feedback CF
my $TicketType = $Ticket-FirstCustomFieldValue('RequestFeedback');

# We want resolved status
return 0 unless $Ticket-Status eq resolved;

# and... we want the CF to be Y
return 0 unless $TicketType eq 'Y';
return 1;


I tried a lot of different variations on the theme, along the lines of:
return 0 if $cf-$self-TicketObj-FirstCustomFieldValue(RequestFeedback)
eq N;
return 0 unless
$cf-$self-TicketObj-FirstCustomFieldValue(RequestFeedback) eq Y
return 0 unless
$cf-$self-TicketObj-FirstCustomFieldValue('RequestFeedback') eq Y

but these didn't return anything. I assume there's a problem with my
syntax or how I'm referring to objects but couldn't work it out...
luckily the page linked above has an example that has exactly what I'm
after!

In this case the scrip triggers if the ticket is reopened, then
resolved again - for us this is OK but for others they might want to
only trigger this condition the first time a ticket is resolved. I
think you would need to use another CF to record the result of the
transaction in this case (i.e. if successful then set
CF-SentFeedbackRequest=y or similar) and add an appropriate
condition to check above... but for us it's not required.

Thanks!

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


[rt-users] RT3.8.7 MobileUI Extension 1.01 not saving cookies for iphone browser (solved)

2012-03-05 Thread Chris Herrmann
Hi,

we recently installed RT::Extension::MobileUI 1.01 in our RT 3.8.7 and
all was sunshine and happiness in the land of mobile goodness for some
time. Then one morning it stopped working for my iphone... (iOS 5.01)
(but not other iphone users in our org). Specifically as follows:

- Surf to site (OK)
- Login - doesn't return an error, but just returns to the login page
- Login again - shows me the mobile interface as expected
- Click on any link on the page, or search for anything -- takes me
to login page
- Login again - shows me the link that should have appeared the first time

Basically any time you execute an action, you have to login again,
after which it displays...

So... I think that it's to do with cookies... and it is... I've just
found the answer...

Settings - safari - Accept Cookies (from visited).

(on the iphone itself)

It was previously set to never which I'm guessing must have changed
when I did the last firmware update.

Cheers,

Chris

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


[rt-users] RT3.8.7 using custom fields to restrict sending a reply on resolve

2012-02-27 Thread Chris Herrmann
Hi,

I'm trying to implement a system so that if a custom field is set to
Y, then the system will send an email (specified by a template) to
the requestor. If the CF is N or blank then it will not send, and
will simply resolve the ticket. I've borrowed from several other
sources such as
http://lists.bestpractical.com/pipermail/rt-users/2010-April/064498.html
and 
http://tpokorra.blogspot.com.au/2009/01/request-tracker-scrip-that-involves.html
but my end goal is a little different.

I've tried various combinations of things that I'll describe in more
detail below, but the short version is that I cannot get it to
correctly send when CF=Y and not send when CF=N.

So far I have:

- Created a template for the email (this part works OK - it looks
correct when I test it)
- Have created a scrip as follows on a test internal queue...

Description:SendFeedbackOnResolve
Condition: On Resolve
Action: AutoReply to Requestors
Template: MyCustomTemplate
Stage: TransactionCreate

Custom Condition:
my $trans = $self-TransactionObj;
my $ticket = $self-TicketObj;

if  ($trans-Type eq 'CustomField')
{my $cf = new RT::CustomField($RT::SystemUser);
 $cf-LoadByName(Queue = $ticket-QueueObj-id,Name = RequestFeedback);
 return 0 unless $cf-id;
 if  ($trans-Field == $cf-id 
  $trans-NewValue eq Y)
  {
   return 1;
  }
}
return 0;

==
This custom condition sends the email in every circumstance.
If I add Custom action preparation code: return 1; it does not appear
to change the behaviour
If I add Custom action cleanup code: return 1/0; it modifies the
behaviour as follows:
1 -- sends email
0 -- doesn't send email

If I move that code to the action clean code block it always sends a message.

I've also tried with TransactionBatch instead of create, and action
NotifyRequestors but with no success.

Help! As you may have guessed I'm not a coder, so I've instead tried
to work through permutations to see how changing things impacts the
result... unfortunately none of it as desired :/

One thing that occured to me (but I don't know how to do) is to change
the action to User Defined and then if the conditions are met, to
trigger an auto-reply with the desired template BUT I don't know how
to do this...

Thanks in advance,

Chris

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] RT 3.8.7 Forward Transaction or Ticket shows up as attachment rather than inline

2011-09-14 Thread Chris Herrmann
Hi Thomas,

Thanks for this. We're not ready yet to move to RT4 as we have other
dependant systems (billing, reporting) that will need to be upgraded to work
with RT4.

Conceptually I think forwarding an entire ticket is OK as an attachment, but
forwarding a single comment should not be - it should essentially work the
same way as any regular comment reply, except that the forward button
grabs the contents of the transaction in question and prepopulates the
content area, so that it can be modified if required.

I'll check ForwardFromUser a bit later, thanks for the pointer.

Regards,

Chris


RT 4.0.2 improves the format of forwards.  Tickets and transactions are
still forwarded as an attachment, rather than inline, but in our testing
the new format was handled much better by mail clients, including gmail.

Inline forwarding is something we briefly discussed, but it's not
planned at the moment.  There are some questions to how it would work,
especially formatting-wise when sending an entire ticket instead of a
single transaction.

 The other issue with the forwarded ticket is that the from address does
 not pick up the queue address or Chris via RT with the correct email
 address, rather it picks up the system default address.

That should not be the case, even in 3.8.7.  If the ForwardFromUser
option is enabled, then the user's address will be used, otherwise the
queue correspond address is used, and failing that, the system default
correspond address.

Thomas

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26  27, 2011
*  San Francisco, CA, USA — October 18  19, 2011
*  Washington DC, USA — October 31  November 1, 2011
*  Melbourne VIC, Australia — November 28  29, 2011
*  Barcelona, Spain — November 28  29, 2011

[rt-users] RT 3.8.7 Forward Transaction or Ticket shows up as attachment rather than inline

2011-09-07 Thread Chris Herrmann
Hi all,

is there a way of making the forward transaction / ticket function forward
the content in the way that it was initially generated, rather than as an
attached eml file? So the text content of a transaction should appear as
inline text, and any attachments should appear as attachments, rather than
as attachments embedded within an attached email.

Outlook opens up the attached files OK, but gmail won't, iphone won't etc.

Currently the template for Forward Ticket is very sparse:

-

This is a forward of ticket #{ $Ticket-id }
-

The other issue with the forwarded ticket is that the from address does not
pick up the queue address or Chris via RT with the correct email address,
rather it picks up the system default address.

Im not sure but I'm guessing that I might be able to fix the format through
a slightly more descriptive template but am not sure where to start..

Thanks,

Chris

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA — September 26  27, 2011
*  San Francisco, CA, USA — October 18  19, 2011
*  Washington DC, USA — October 31  November 1, 2011
*  Melbourne VIC, Australia — November 28  29, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] RT 3.8.7 fails to send email sometimes - cannot allocate memory?

2011-08-07 Thread Chris Herrmann
Ok, postscript: I haven't seen the problem occur in the week since making
the change. Memory usage on the box hasn't really changed at all, but the
error messages and the symptom have ceased and performance is still great so
currently looks like case closed, thankyou!

Regards,

Chris

On 2 August 2011 10:43, Chris Herrmann chrisherrma...@gmail.com wrote:

 Yes, I've grabbed the mrtgs for memory usage, and at about 9:30am yesterday
 free ram plummeted on the box, and cleared itself up at about 12:30 or
 shortly before I started looking at it. There are a few times a day when
 free memory gets very low, but they don't correlate with cron jobs...

 I've tried tuning the following parameters in apache:

 MaxClients  50

 MaxRequestsPerChild   1

 dropping from 150, 0 respectively. The server doesn't host any high volume
 / usage sites and spends most of it's day counting sheep so I'd rather the
 (presumably) extra memory allocated per child and auto-cycling children in
 case of memory leaks. I'll watch this for a few days and see how memory
 usage on the box compares then report back.



2011 Training: http://bestpractical.com/services/training.html

[rt-users] External access for rt

2011-08-04 Thread Chris Herrmann
Is rt configured as a virtual host to only respond to a particular URL? For 
example surfing to http://10.0.0.1 is not the same as surfing to your external 
ip or hostname myrt.mycompany.com.  

Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


2011 Training: http://bestpractical.com/services/training.html


[rt-users] Relative month handling

2011-08-04 Thread Chris Herrmann
You'll need to do it from a shell script or similar; that type of syntax 
doesn't work using the rt query language. I have some scripts that ive posted 
previously that are probably close to what you want. They are intended to 
execute from cron and email a tab separated file to you of results. 

Regards

Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au


2011 Training: http://bestpractical.com/services/training.html


[rt-users] RT 3.8.7 fails to send email sometimes - cannot allocate memory?

2011-08-01 Thread Chris Herrmann
Hi,

We have a strange situation where sometimes emails that should be sent are
not received (for example upon a reply via web or email).

I spent some time today trying to work out when this occurred, only to find
that it was working as expected for various permutations of reply / comment
etc to requestor / CC / Admin CC until I went digging for a specific
ticket that I knew we'd witnessed this error with today.

This is what appeared in the logs when I (the owner) replied using the web
interface, which should have sent an email back to the requestor:

Aug  1 12:05:22 sirius RT: 
rt-3.8.7-28432-1312164322-125.78931-1...@faredge.com.au #78931/638647 -
Scrip 14 Notify Owner of Change
(/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:300)
Aug  1 12:05:22 sirius RT: 
rt-3.8.7-28432-1312164322-125.78931-1...@faredge.com.au: Could not send
mail with command `/usr/sbin/sendmail -oi -t`: couldn't execute program:
Cannot allocate memory at
/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm line
432.#012#012Stack:#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm:432]#012
[/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:307]#012
[/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:129]#012
[/usr/share/request-tracker3.8/lib/RT/ScripAction_Overlay.pm:238]#012
[/usr/share/request-tracker3.8/lib/RT/Scrip_Overlay.pm:464]#012
[/usr/share/request-tracker3.8/lib/RT/Scrips_Overlay.pm:196]#012
[/usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm:188]#012
[/usr/share/request-tracker3.8/lib/RT/Record.pm:1457]#012
[/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm:2831]#012  [(eval
3450):12]#012
[/usr/share/request-tracker3.8/lib/RT/ScripAction_Overlay.pm:238]#012
[/usr/share/request-tracker3.8/lib/RT/Scrip_Overlay.pm:464]#012
[/usr/share/request-tracker3.8/lib/RT/Scrips_Overlay.pm:196]#012
[/usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm:188]#012
[/usr/share/request-tracker3.8/lib/RT/Record.pm:1457]#012
[/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm:3323]#012
[/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm:2996]#012
[/usr/share/request-tracker3.8/lib/RT/Record.pm:898]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:1340]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:1450]#012
[/usr/share/request-tracker3.8/html/Ticket/Display.html:156]#012
[/usr/share/request-tracker3.8/html/Ticket/Update.html:261]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:320]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:224]#012
[/usr/share/request-tracker3.8/html/autohandler:53]
(/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm:448)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-42.79722-...@faredge.com.au #79722/638648 - Scrip
4 On Correspond Notify AdminCcs
(/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:300)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-42.79722-...@faredge.com.au No recipients found.
Not sending. (/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm:342)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-331.79722-...@faredge.com.au #79722/638648 -
Scrip 6 On Correspond Notify Other Recipients
(/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:300)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-331.79722-...@faredge.com.au No recipients found.
Not sending. (/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm:342)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-628.79722-...@faredge.com.au #79722/638648 -
Scrip 5 On Correspond Notify Requestors and Ccs
(/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:300)
Aug  1 12:05:24 sirius RT: 
rt-3.8.7-28430-1312164324-628.79722-...@faredge.com.au: Could not send mail
with command `/usr/sbin/sendmail -oi -t`: couldn't execute program: Cannot
allocate memory at /usr/share/request-tracker3.8/lib/RT/Interface/Email.pm
line 432.#012#012Stack:#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Email.pm:432]#012
[/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:307]#012
[/usr/share/request-tracker3.8/lib/RT/Action/SendEmail.pm:129]#012
[/usr/share/request-tracker3.8/lib/RT/ScripAction_Overlay.pm:238]#012
[/usr/share/request-tracker3.8/lib/RT/Scrip_Overlay.pm:464]#012
[/usr/share/request-tracker3.8/lib/RT/Scrips_Overlay.pm:196]#012
[/usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm:188]#012
[/usr/share/request-tracker3.8/lib/RT/Record.pm:1457]#012
[/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm:2175]#012
[/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm:2087]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:1147]#012
[/usr/share/request-tracker3.8/html/Ticket/Display.html:146]#012
[/usr/share/request-tracker3.8/html/Ticket/Update.html:261]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:320]#012
[/usr/share/request-tracker3.8/lib/RT/Interface/Web.pm:224]#012
[/usr/share/request-tracker3.8/html/autohandler:53]

Re: [rt-users] RT 3.8.7 fails to send email sometimes - cannot allocate memory?

2011-08-01 Thread Chris Herrmann
But the box has heaps of memory free on it. I've been searching but can't find 
anything that tells you how to up the per thread / process / etc memory limit. 
You can tune the number of workers and so forth in apache, but I don't expect 
dropping that to help if there is still 1.5g free ram on the box?


2011 Training: http://bestpractical.com/services/training.html


Re: [rt-users] RT 3.8.7 fails to send email sometimes - cannot allocate memory?

2011-08-01 Thread Chris Herrmann
Yes, I've grabbed the mrtgs for memory usage, and at about 9:30am yesterday
free ram plummeted on the box, and cleared itself up at about 12:30 or
shortly before I started looking at it. There are a few times a day when
free memory gets very low, but they don't correlate with cron jobs...

I've tried tuning the following parameters in apache:

MaxClients  50

MaxRequestsPerChild   1

dropping from 150, 0 respectively. The server doesn't host any high volume /
usage sites and spends most of it's day counting sheep so I'd rather the
(presumably) extra memory allocated per child and auto-cycling children in
case of memory leaks. I'll watch this for a few days and see how memory
usage on the box compares then report back.


2011 Training: http://bestpractical.com/services/training.html

[rt-users] Queue not receiving/ forwarding emails

2011-03-24 Thread Chris Herrmann
Create a custom contact in exchange with the address set to your queue email 
add. For eg:

In exchange create a contact for queuen...@mydomain.com that points at
queuen...@myrthost.mydomain.com

Then use rt mailgate to parse incoming  emails. 

Chris Herrmann
Far Edge
+612 84251400
+614 03393309
http://www.faredge.com.au

[rt-users] Setup RT with existing postfix on separate server

2011-03-17 Thread Chris Herrmann
Hi Donny,

I'm not clear if we're using a similar type of setup to what you're referring 
to, but I'll fill in how we do it and hopefully it'll help you...

We have:


- RT box running exim. Exim is setup to smarthost through our front 
facing mail server, and to integrate with RT queue names. It has a local 
dnsname of hostname.faredge.com.au .

- Qmail frontend server which is configured to forward any matching 
mails for the specific aliases to queuename@ourrtserver, and handles external 
mail. It also forwards any messages for exchange users to the exchange server.

- An Exchange server which has contacts setup for each queue in 
question so that a message for Queue is correctly forwarded through to 
queuename@ourrtserver. The exchange domain is the local windows domain (as 
opposed to faredge.com.au)

It's a bit more complicated than it needs to be, but is in place mainly for 
historical reasons and as it works well so far there and hasn't introduced a 
huge overhead there's no great pressure to change it.

So Donny, I'm not sure about the postfix side of what you're trying to do - 
basically make sure you have aliases that relate to each queue that live at 
your RT server for example:

donnysqu...@donnysrtserver.domain.commailto:donnysqu...@donnysrtserver.domain.com
 which is delivered to your RT server. Your alias for this email should forward 
it to RT's mail handler (this is a web service, but not sure of the URL 
structure off the top of my head).
  Setup a contact in exchange to forward 
donnysqu...@domain.commailto:donnysqu...@domain.com to 
donnysqu...@donnysrtserver.domain.commailto:donnysqu...@donnysrtserver.domain.com


You can get funkier by automatically setting up new emails based upon queue 
name etc as we have, but it's not necessary to make it work.

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au



Re: [rt-users] problem with cf in spreadsheet download

2011-02-02 Thread Chris Herrmann
Custom fields aren't exported correctly in the spreadsheet export function - 
the column headings don't match the actual data.

If you specify the field names using the CLI it will return the expected fields 
with the expected column names.

For example:

  rt list queue = 'myqueue' -f id, 
subject,requestors,created,CF-customfield1,CF-customfield2


Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au



Re: [rt-users] Passing date variables as dates from the CLI

2011-02-01 Thread Chris Herrmann
Hi Kevin,

Thanks, yes I'm running it from a bash script which in turn is called from cron 
and the variables are substituting correctly, and I got my first automated rt 
queries last night on schedule :) . Next up is creating some more scheduled 
jobs that run through on a daily basis or maybe more often and look for content 
such as SPAM and deleting these, or auto-resolving tickets that are 
notifications about successful backup jobs that require no attention, for 
example.

If anyone would like copies of the various scripts (bash wrapper + rt query + 
cron wrapper to run on the last day of the month) email me off list and I'll 
send you a copy.

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au



[rt-users] Passing date variables as dates from the CLI

2011-01-30 Thread Chris Herrmann
Hi Thomas,

Thanks for your reply, I'll try generating query files with all the variables 
already substituted and then executing the contents of these files instead and 
see how I go.

I admit I'm a bit surprised that this isn't supported (you can do it in perl 
for example) - it seems like a fairly obvious use case if you're going to 
bother having a CLI at all, how are you going to automate properly without 
variables? For example dates (as per my example) but also getting usernames 
from the shell, new queues / clients etc as you create them. Anyway, just my 
thoughts. Also not having the ability to export the results to email as an 
attachment (I worked around this by mutt), or to generate CSV format instead of 
TSV .

Do ideas for new features get submitted to the bugs list or is there somewhere 
else they should go?

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au


snip



You don't.  bin/rt doesn't do variable substitution.  If you need to use 
environment variables then you need to do it without dropping into bin/rt's 
shell.



Thomas

/snip


[rt-users] Passing date variables as dates from the CLI

2011-01-27 Thread Chris Herrmann
Ok, some more things. I think it's an RT bug not a bash problem... actually I 
think there are two (possibly separate) bugs. Actually I'm not editing the 
email after having done some more testing, and there is only one problem... but 
I'll leave the (brief) journey in to show how I got there.



1. If you create any arbitrary variable that contains a date string (in any 
format... -MM-DD,  DD-MM- etc etc) and try to use this with a  
operator it will return no results, regardless of how you create the variable. 
For example, I was previously trying to build a date string (which produces a 
correctly formatted date string for the variable) but this didn't work. So I 
tried typing 
enddate=2011-02-01
and this does not work either. If I replace the variable in the rt cli query 
with the literal values then it works correctly. Have also tried exporting the 
variables - it appears to make no difference. I also tried other variable names 
startdate / randomdate / thisnamecannotbereserved etc.

2. If you are using a date variable with the  operator you get a different 
result - it returns a whole set of data rather than restricting by the date in 
question.

Actually, the problem is more with variables fullstop...

faredge@sirius:~$ rtqueryqueue=myrtqueue;export rtqueryqueue
faredge@sirius:~$ rt
rt list queue = '$rtqueryqueue'
Query:queue = '$rtqueryqueue'
No matches found
rt

If I run this by typing the queue name into the cli, it works OK.

So... then I guess the question becomes how do I correctly pass environment 
variables into the RT CLI so that they're substituted correctly?

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au   


[rt-users] cannot display requestor or requestors attributes in rt CLI when specifying fields

2011-01-26 Thread Chris Herrmann
Hi Emmanuel,

Thanks, the patch doesn't apply:

root@sirius:/usr/share/request-tracker3.8# patch -p2  /tmp/thepatch
patching file html/REST/1.0/Forms/ticket/default
patch:  malformed patch at line 14:  $time = new RT::Date 
($session{Curr  
entUser});

=
root@sirius:/tmp# cat thepatch
diff --git a/share/html/REST/1.0/Forms/ticket/default 
b/share/html/REST/1.0/Forms/ticket/default
index 0d403b2..280ab55 100755
--- a/share/html/REST/1.0/Forms/ticket/default
+++ b/share/html/REST/1.0/Forms/ticket/default
@@ -202,7 +202,7 @@ if (!keys(%data)) {

 foreach $key (@people) {
 next unless (!%$fields || (exists $fields-{lc $key}));
-push @data, [ $key = [ $ticket-$key-MemberEmailAddresses ] ];
+push @data, [ $key =
+ $ticket-$key-MemberEmailAddressesAsString ];
 }

 $time = new RT::Date ($session{CurrentUser});

root@sirius:/tmp#

This occurs twice in that file (approx. line 202  line 310). The other 
matching text you've flagged there narrows it down to the block @ line 202...

Ok, found it:

205:push @data, [ $key =  [ $ticket-$key-MemberEmailAddresses  ]  ];

To

push @data, [ $key =  $ticket-$key-MemberEmailAddresses  ];

and it's now working... yay! I need to check a few other things in our staging 
environment first, and then will deploy to prod.

Dominic: Yes, agree but I need a way of making this work right now, so for the 
moment I'll update our internal documentation around deploying upgrades for RT 
and a note to check this functionality. We have several other systems that 
depend upon RT (like billing for example) so we don't tend to upgrade RT very 
often, only when we're looking for some significant new functionality.

What's the protocol for me to post this up as a suggestion for this fix to 
become incorporated back into the main 3.8 code base so that future releases 
will include it? (assuming that this isn't going to break some other piece of 
critical functionality!).

Something weird I did notice (unrelated I think):

rt list id = 68667 -f id,requestors,subject
id  Subject Requestors
68667   My testing ticketch...@noemail.com

Notice that the order of the requestors  subject field is reversed? The 
headings in the results are the right way around though. It's not critical but 
curious as to why.

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au



[rt-users] Passing date variables as dates from the CLI

2011-01-26 Thread Chris Herrmann
Hi all,

Another problem to do with (I suspect) dates not be treated as dates.

My script has this block at the front to set some variables, so that I can 
eventually run it from a regular cron job:

startmonth=`date +%m`
startyear=`date +%Y`
endyear=$startyear
friendlymonth=`date +%b`
reportperiod=$friendlymonth $startyear
if [ $startmonth = 12 ];then
   endyear=$(($startyear+1))
   endmonth=1
else
   endyear=$startyear
   endmonth=$(($startmonth+1))
fi
startdate=1/$startmonth/$startyear
enddate=1/$endmonth/$endyear

Idea being to put the start  end dates into variables startdate and 
enddate to restrict the report range.

If I run:

   rt list queue = 'myqueue' and created  '$startdate'

It returns results correctly.

If I run:
   rt list queue = 'myqueue' and created  '$enddate'

It says No matches found.

If I manually enter:

  rt list queue = 'myqueue' and created  
'1/2/2011'

Then it works correctly.

root@sirius:/ # echo $startdate $enddate
1/01/2011 1/2/2011

They're obviously different - startdate has a month of 01 whilst enddate 
is 2. But startdate works, and enddate not...

Is there some way I need to format the resulting variable differently so that 
it knows it's a date and is treated as such?

Thanks,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au



Re: [rt-users] Passing date variables as dates from the CLI

2011-01-26 Thread Chris Herrmann
But dd/mm/ also works – $startdate works for example. Or if you type 
“1/1/2011” this will work, which doesn’t have the leading zero.

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au

From: Josh Narins [mailto:jnar...@seniorbridge.com]
Sent: Thursday, 27 January 2011 14:14
To: Chris Herrmann; 'rt-users@lists.bestpractical.com'
Subject: Re: [rt-users] Passing date variables as dates from the CLI


-mm-dd works, but you'll want(need?) leading zeroes for mm and dd.



[rt-users] cannot display requestor or requestors attributes in rt CLI when specifying fields

2011-01-13 Thread Chris Herrmann
Hi all,

First post so apologies in advance if I miss something. Long time user, but 
have only just started playing with the CLI. What I'm trying to do is setup a 
bash script that uses the CLI to export data from RT on a regular basis.

Environment details:
- RT 3.8.7
- Ubuntu x64 2.6.32-26-server
- Apache/2.2.14
- Perl v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
- Modules / Plugins:
o RTFM 
o RTx::EmailCompletion
o RT::Extension::MergeUsers
- MySQL 5.1.41-3
Sorry not sure what versions of these modules  plugins.

Originally I had another problem which is that I couldn't get a bash script to 
execute an RT cli, pass in variables, and email the results as an attachment to 
a specified address but that's now sorted... except that if I cannot get the 
email address associated with a ticket requestor.

To illustrate:
rt show ticket/71900
Date: Wed Jan 12 08:21:05 2011
From: chrisdotherrrmannatfaredgedotcomdotau
X-Queue: helpdesk
Subject: [rt #ticket/71900] New Service Call  -  Default Wallpaper too large
rt

but if I try and get the requestor email (which is me):

rt list id = 71900 -f id,requestor,requestors,subject
id  Subject Requestors
71900   New Service Call - Default Wallpaper too large ARRAY(0x7fbf6db32a58)
  
rt list id = 71900 -f id,requestor,subject
id  Subject
71900   New Service Call - Default Wallpaper too large

rt list id = 71900 -f id,requestors,subject
id  Subject Requestors
71900   New Service Call - Default Wallpaper too large ARRAY(0x7fbf6dd46788)

So... the requestors field returns ARRAY(0x..) whereas the requestor 
field is just ignored. The term Requestor is used if you run:

rt list id = 71900

but the results are obscured because they're too long to fit on the screen 
properly.

 If I use from instead (because this is what the show ticket/71900  calls 
it... I get the same result as if I'd used requestor. In fact if I use any 
random non-reserved word in there it's ignored, which leads me to suspect that 
requestor is not actually what I'm looking for. I originally used 
requestors because this is what the export spreadsheet function from the GUI 
calls the field - and indeed if you export a spreadsheet from a list of tickets 
in the GUI it correctly exports the email address of the requestor (but ignores 
the settings relating to which fields to export - it exports every field in 
it's own order that does not match the order of the column headings, but that's 
a separate issue...).

I've also tried things like requestors.email but this returns:

rt list id = 71900 -f id,requestors.email,subject
rt: list: No valid field list in '-f id,requestors.email,subject'.
rt: For help, run 'rt help list'.
rt: For help, run 'rt help ticket'.


  rt
If I try to use the CC or AdminCC fields from the cli they experience the same 
issue.

Does anyone have any ideas on things I could try? Alternatively, is there some 
nifty way that RT can be configured to produce a friendly CSV style file and 
email it on a regular schedule including custom field data? If anyone's 
interested what I've got so far is attached below.

I started looking at doing this direct from a database but my head started 
hurting - for example there's no simple way of returning the current requestor 
- you have to traverse all relevant transactions and work it out that way (and 
if there is  1 requestor make a decision about which one to choose). So if you 
have a db script that will do this then I'll gratefully look  test it but I 
probably won't venture down the path of writing it myself just now...

Regards,

Chris Herrmann
Far Edge Technology

p. 02 84251400
m. 0403 393309
http://www.faredge.com.au   



startmonth=`date +%m`; export startmonth
startyear=`date +%Y`; export startyear
endyear=$startyear; export endyear
friendlymonth=`date +%b`
reportperiod=$friendlymonth $startyear
if [ $startmonth = 12 ];then
endyear=$(($startyear+1))
endmonth=1
else
endyear=$startyear
endmonth=$(($startmonth+1))
fi
export endyear
startdate=1/$startmonth/$startyear ; export startdate
enddate=1/$endmonth/$endyear ; export enddate
touch blankreport #doing this because Mutt expects data to be in the message

RTUSER=reportinguser; export RTUSER
RTSERVER=http://myrtserver/; export RTSERVER
RTPASSWD=reportinguserpass; export RTPASSWD
rt list queue = 'myrtqueue' and created  '$startdate' and created  
'$enddate' and (status !='rejected' AND status != 'deleted') -f 
id,subject,requestor,created,CF-firstname,CF-surname,CF-phone,CF-addressline1,CF-addressline2,CF-state,CF-postcode,CF-typeofdevice,CF-dateofpurchase,CF-ReceiptNo,CF-tickettype
  /tmp/$startyear$startmonthCallReport.txt
mutt -s Monthly Queue Results -a 
/tmp/$startyear$startmonthMontlyCallReport.txt