[rt-users] RT 4.2 query; RequestorGroup != 'admin'

2015-08-28 Thread Richard McMahon

Hello,

I have an RT query created with the query builder that RequestorGroup.

Status = '@owner'

returns 163 tickets

Status = '@owner' AND  RequestorGroup = 'admin'

returns 101 tickets

This lists all issues where the Requestor is a member of the admin group.

I would like to list all tickets where the Requestor is not a member of
the admin group.

I expected this query to work.

Status = '@owner' AND RequestorGroup != 'admin'

I also tried NOT LIKE 'admin'

These give the error:

There was an error parsing your search query: Invalid RequestorGroup Op: 
!=. Your RT admin can find more information in the error logs.


This looks like a bug to me.

regards Richard


[rt-users] Ticket Updates only for Comments/Correspondence

2014-05-25 Thread Richard McMahon

Hello,

In order to identify activity we have a series of dashboards that use 
constraints like:


updated  last week; updated  last month; Updated  '-4 weeks'

This is getting cluttered up with minor transactions like e.g.

Reference by Ticket  
Member ticket XXX added
Dependency by ticket  added

We would like to only list tickets where there has been a significant 
updat ie


comment or corresponce in the time window.


From a query point of view it would be useful to have


Last updated option that only included Comments and/or Correspondence
transactions.

ie
Last Comment
Last Correspondence

Comments or pointers appreciated.

Regards Richard

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


Re: [rt-users] Chart and Show Results not showing correct query

2013-12-19 Thread Richard McMahon


I meant to say that we are using RT 4.0.17.


On Wed, 18 Dec 2013, Kevin Falcone wrote:


Date: Wed, 18 Dec 2013 11:31:37 -0500
From: Kevin Falcone falc...@bestpractical.com
Reply-To: rt-users@lists.bestpractical.com
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Chart and Show Results not showing correct query

On Tue, Dec 17, 2013 at 09:12:17PM +, Richard McMahon wrote:


I have been using the Chart option in RT 3.8. When I click on Show
Results a different query is shown e.g. the most recent other saved
query.


RT 3.8 is no longer receiving anything other than security bugfixes.
You also don't specify which version of 3.8 you're running, but it's
quite likely that some of your complaints have been addressed in the
new charting in 4.2.

If you can replicate these bugs on 4.2, please let us know.

-kevin


Also, it would be useful if the Total result in the table on the
Chart executed the full query. See attached chart.

Related to the above is the ability to edit the query than creates
a chart. I get inconsistent results so it looks like the query
linked to a saved Chart might be a clone of the query run when the
Chart is saved.

thanks Richard







---
 Prof Richard G. McMahon   | Phone (office)  44-(0)-1223-337519
 Kavli Institute for Cosmology |(secretary) 1223-337516
 Institute of Astronomy|(switchboard)   1223-337548
 University of Cambridge   |
 Madingley Rd  | FAX1223-337523
 Cambridge, CB3 OHA, UK.   | mobile 7885-409019
 Office: Kavli 22  |
---
 email: r...@ast.cam.ac.uk  | WWW: http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype: richardgmcmahon
---


[rt-users] Chart and Show Results not showing correct query

2013-12-17 Thread Richard McMahon


Hello,

I have been using the Chart option in RT 3.8. When I click on Show Results 
a different query is shown e.g. the most recent other saved query.


Also, it would be useful if the Total result in the table on the 
Chart executed the full query. See attached chart.


Related to the above is the ability to edit the query than creates
a chart. I get inconsistent results so it looks like the query
linked to a saved Chart might be a clone of the query run when the
Chart is saved.

thanks Richard



RT_ToldMonthly.png
Description: Binary data


Re: [rt-users] RT 4.2 on rt.easter-eggs.org

2013-10-22 Thread Richard McMahon


Excellent, this nicely showcases some of the new charting features.



done, I changed the urls so please got to
http://rt.easter-eggs.org/demos/, you'll find 3.8, 4.0 and 4.2




---
 Prof Richard G. McMahon   | Phone (office)  44-(0)-1223-337519
 Kavli Institute for Cosmology |(secretary) 1223-337516
 Institute of Astronomy|(switchboard)   1223-337548
 University of Cambridge   |
 Madingley Rd  | FAX1223-337523
 Cambridge, CB3 OHA, UK.   | mobile 7885-409019
 Office: Kavli 22  |
---
 email: r...@ast.cam.ac.uk  | WWW: http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype: richardgmcmahon
---


[rt-users] RT 4.2 on rt.easter-eggs.org

2013-10-20 Thread Richard McMahon


Hi, I am checking some charting feature issues in RT4.0.17 and before I 
report on them I would like to see if they are 'fixed' in RT 4.2.


I use rt.easter-eggs.org to check features against our own implementation 
which is 4.0.17. The rt.easter-eggs.org is is very useful for testing.


Is there any chance that rt.easter-eggs.org could updated to 4.2. I 
realise that this is not a Best Practical supported site.


Thanks, Richard

---
 Prof Richard G. McMahon   | Phone (office)  44-(0)-1223-337519
 Kavli Institute for Cosmology |(secretary) 1223-337516
 Institute of Astronomy|(switchboard)   1223-337548
 University of Cambridge   |
 Madingley Rd  | FAX1223-337523
 Cambridge, CB3 OHA, UK.   | mobile 7885-409019
 Office: Kavli 22  |
---
 email: r...@ast.cam.ac.uk  | WWW: http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype: richardgmcmahon
---



Re: [rt-users] RT config files different instances

2012-07-21 Thread Richard McMahon


OK, I will aim to use compatible RT API libraries. I can host more than 
one version on the remote client if required.


It would be useful to be able to determine the version of RT running on 
the client and server via the API. I can use REST to determine the

version of the RT on the remote version:

e.g. http:///REST/1.0 returns

RT/3.8.HEAD 401 Credentials required

Is there a way to access/report the RT version library verion from
within Perl. In Python I would use something like:

print 'matplotlib.__version__: ', matplotlib.__version__

thanks

On Thu, 19 Jul 2012, Ruslan Zakirov wrote:


Date: Thu, 19 Jul 2012 22:19:51 +0300
From: Ruslan Zakirov ruslan.zaki...@gmail.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT config files different instances

Hi,

Sorry for delay. Didn't know how to describe situation.

1) Don't use REST for anything except creating and replying to
tickets. REST needs complete rewrite.

2) Anything that does reporting via higher level than perl API will
suffer performance issues at some point.

3) You can write a perl program that talks to one set of RT libraries
at a moment.

4) You can write a program that can work with 3.8 API and 4.0 API.

5) Never use RT libraries that don't match DB.

On Mon, Jul 16, 2012 at 12:57 PM, Richard McMahon r...@ast.cam.ac.uk wrote:


OK, my current two RT instances are 3.8(production) and
4.05 (Development). The 3.8 system will move to 4.06 soon.

Use of REST is a possibility but would be mission creep at
the moment.

To avoid problems it would be useful to be able to get the RT version
numbers programmatically for:

(i)  local RT API libraries

(ii) remote host [this could use REST] if the local API does not
support it.

r.





---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] RT config files different instances

2012-07-16 Thread Richard McMahon


OK, my current two RT instances are 3.8(production) and
4.05 (Development). The 3.8 system will move to 4.06 soon.

Use of REST is a possibility but would be mission creep at
the moment.

To avoid problems it would be useful to be able to get the RT version 
numbers programmatically for:


(i)  local RT API libraries

(ii) remote host [this could use REST] if the local API does not
support it.

r.


On Sun, 15 Jul 2012, Ruslan Zakirov wrote:


Date: Sun, 15 Jul 2012 16:51:48 +0300
From: Ruslan Zakirov ruslan.zaki...@gmail.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT config files different instances

On Sun, Jul 15, 2012 at 1:14 AM, Richard McMahon r...@ast.cam.ac.uk wrote:


Yes, I am using the API for reporting.

Can the API report the version of the local RT API being used and the RT
version that is running on the remote host?


No.

Problem here is that you need RT source code to match DB. You can not
use one codebase to talk to different DBs that have different versions.

You don't talk about REST interface, right?


r.
On Sat, 14 Jul 2012, Ruslan Zakirov wrote:

Date: Sat, 14 Jul 2012 23:15:47 +0300
From: Ruslan Zakirov ruslan.zaki...@gmail.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT config files different instances



Even if you can make it work, there is no guaranty it will work acros
versions of RT. Do you use RT API for reporting?

Ruslan from phone.

14.07.2012 15:22 пользователь Richard McMahon r...@ast.cam.ac.uk
написал:
  Hello,

  I have a a few different RT instances and I am running reports
  remotely, see exampe code below.

  At the moment I have all the passwords in each report script but
  I would like to move the DB info and passwords to configuration
  files and specify the config files as command line options using
  Getopt::Long.

  I am considering using the perl module Config::Tiny to read
  the configuration information. Are there any other suggestions?

  e.g. should/can I uses RT's own configuration handler. If yes,
  where is a good place to start? Thiscwould also mean less
  extra Per modules needed. I will share the reporing scripts
  when I have finished.

  e.g this is what I do now:

  RT::LoadConfig();

  # set/change some Config values
  if host=host1) {
RT-Config-Set( DatabaseType = 'mysql' );
RT-Config-Set( DatabaseHost = 'host1.ast.cam.ac.uk' );
RT-Config-Set( DatabaseName = 'rt3' );
RT-Config-Set( DatabaseUser = 'rgm');
RT-Config-Set( DatabasePassword = 'NotaPassword');
RT-Config-Set( LogDir = '/home/rgm/soft/rt/host1/log/' );
  }

  if (host=host2) { }

  RT::Init();

  r.


  ---
   Dr. Richard G. McMahon| Phone (office)
  44-(0)-1223-337519
   University of Cambridge   |   (switchboard)
  1223-337548
   Institute of Astronomy|   (secretary)
  1223-337516
   Madingley Rd  | FAX
  1223-337523
   Cambridge, CB3 OHA, UK.   | mobile
   7885-409019
   Office: Hoyle 18  | home
   1223-359770
  ---
   email: r...@ast.cam.ac.uk  | WWW:
   http://www.ast.cam.ac.uk/~rgm
   richardgmcma...@gmail.com | skype:
   richardgmcmahon
  ---





---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---







---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype

Re: [rt-users] searching for tickets that haven't had a response yet?

2012-07-14 Thread Richard McMahon


I posted something on this last year and reported the issue
in the RT Issue tracker:

see:
http://issues.bestpractical.com/Ticket/Display.html?id=18353

The problem is that unlike ALL other times, the default value
for Told is a NULL rather than the UNIX zero of 1970.

The TicketSQL Time functions 'ignore' the NULL so you TicketSQL will not 
return the Not Set values when you try Told  'time'.


IMHO this is a bug in a very good system and hampers the use of the Told 
time to identify tickets with no response.


Maybe a fix is planned.

r.

On Wed, 11 Jul 2012, Bill Cole wrote:


Date: Wed, 11 Jul 2012 15:42:08 -0400
From: Bill Cole rtusers-20090...@billmail.scconsult.com
Reply-To: RT Users (RT-Users@lists.bestpractical.com)
rt-users@lists.bestpractical.com
To: RT Users (RT-Users@lists.bestpractical.com)
rt-users@lists.bestpractical.com
Subject: Re: [rt-users] searching for tickets that haven't had a response yet?

On 11 Jul 2012, at 10:27, Roedel, Mark wrote:

What's the proper TicketSQL to return the list of tickets that don't yet 
have a Told date set?


The answer to that may be version sensitive, since it appears to me that 
there is breakage in at least versions 3.8.7, 3.8.11, and 4.0.5. You will 
note that these are all not the most recent releases.


You SHOULD be able to use:

Told = '1970-01-01'

or:

Told = 'Not set'

However, neither of those criteria works. I believe they *should* because 
they both work with 'Due' instead of 'Told' and those are the same data type. 
They are both manipulated by RT::Date and can logically be unset for a 
ticket. Unfortunately, there's also a clue to something wrong in that if you 
sort a list by Due the 'Not set' tickets are before any others, but if you 
sort a list by Told they sort as if Told is in the future, yet searching for 
Told after the current date also fails to find those tickets.






---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


[rt-users] RT config files different instances

2012-07-14 Thread Richard McMahon

Hello,

I have a a few different RT instances and I am running reports
remotely, see exampe code below.

At the moment I have all the passwords in each report script but I would 
like to move the DB info and passwords to configuration files and specify 
the config files as command line options using Getopt::Long.


I am considering using the perl module Config::Tiny to read
the configuration information. Are there any other suggestions?

e.g. should/can I uses RT's own configuration handler. If yes,
where is a good place to start? Thiscwould also mean less
extra Per modules needed. I will share the reporing scripts
when I have finished.

e.g this is what I do now:

RT::LoadConfig();

# set/change some Config values
if host=host1) {
  RT-Config-Set( DatabaseType = 'mysql' );
  RT-Config-Set( DatabaseHost = 'host1.ast.cam.ac.uk' );
  RT-Config-Set( DatabaseName = 'rt3' );
  RT-Config-Set( DatabaseUser = 'rgm');
  RT-Config-Set( DatabasePassword = 'NotaPassword');
  RT-Config-Set( LogDir = '/home/rgm/soft/rt/host1/log/' );
}

if (host=host2) { }

RT::Init();

r.


---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] RT config files different instances

2012-07-14 Thread Richard McMahon


Yes, I am using the API for reporting.

Can the API report the version of the local RT API being used and the RT 
version that is running on the remote host?


r.


On Sat, 14 Jul 2012, Ruslan Zakirov wrote:


Date: Sat, 14 Jul 2012 23:15:47 +0300
From: Ruslan Zakirov ruslan.zaki...@gmail.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] RT config files different instances


Even if you can make it work, there is no guaranty it will work acros
versions of RT. Do you use RT API for reporting?

Ruslan from phone.

14.07.2012 15:22 пользователь Richard McMahon r...@ast.cam.ac.uk написал:
  Hello,

  I have a a few different RT instances and I am running reports
  remotely, see exampe code below.

  At the moment I have all the passwords in each report script but
  I would like to move the DB info and passwords to configuration
  files and specify the config files as command line options using
  Getopt::Long.

  I am considering using the perl module Config::Tiny to read
  the configuration information. Are there any other suggestions?

  e.g. should/can I uses RT's own configuration handler. If yes,
  where is a good place to start? Thiscwould also mean less
  extra Per modules needed. I will share the reporing scripts
  when I have finished.

  e.g this is what I do now:

  RT::LoadConfig();

  # set/change some Config values
  if host=host1) {
    RT-Config-Set( DatabaseType = 'mysql' );
    RT-Config-Set( DatabaseHost = 'host1.ast.cam.ac.uk' );
    RT-Config-Set( DatabaseName = 'rt3' );
    RT-Config-Set( DatabaseUser = 'rgm');
    RT-Config-Set( DatabasePassword = 'NotaPassword');
    RT-Config-Set( LogDir = '/home/rgm/soft/rt/host1/log/' );
  }

  if (host=host2) { }

  RT::Init();

  r.


  ---
   Dr. Richard G. McMahon    | Phone (office)    
  44-(0)-1223-337519
   University of Cambridge   |       (switchboard)      
  1223-337548
   Institute of Astronomy    |       (secretary)        
  1223-337516
   Madingley Rd              | FAX                      
  1223-337523
   Cambridge, CB3 OHA, UK.   | mobile                  
   7885-409019
   Office: Hoyle 18          | home                    
   1223-359770
  ---
   email: r...@ast.cam.ac.uk  | WWW:  
   http://www.ast.cam.ac.uk/~rgm
   richardgmcma...@gmail.com | skype:              
   richardgmcmahon
  ---





---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---

Re: [rt-users] Perl API: list of available queues, owners, status

2012-07-13 Thread Richard McMahon


Ok, I am nearly there. Yes, I have looked the perldoc but got a little
lost. It is very comprehensive but Perl is my third language :).

I am nearly there. I need the list of possible ticket owners. This is the 
list of people in the admin group, maybe.


My previous report scripts used raw sql but I want to rewrite the reports 
using as much of the RT API code bases as possible.


Below I summarise the input on getting the valid status values; note
we have some extra ones and the queuses

my $lifecycle = RT::Lifecycle-Load('default');
my @statuses = $lifecycle-Valid;

for my $status (@statuses) {
print $status, \n;
}



my $queues = RT::Queues-new( RT-SystemUser );
$queues-UnLimit;
while ( my $queue = $queues-Next ) {
print $queue-Name, \n;
}


So, is there something simialar that list the members who
can own a ticket?

thanks


On Fri, 13 Jul 2012, Tim Cutts wrote:


Date: Fri, 13 Jul 2012 10:01:33 +0100
From: Tim Cutts t...@sanger.ac.uk
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Perl API: list of available queues, owners, status


On 13 Jul 2012, at 01:01, Richard McMahon wrote:


OK, that gets me the queue list.

Is there an API way to get the full list of valid status values


That's part of the configuration; it's not an API as such.  That information is 
all configurable by you in the %Lifecycle configuration (look in RT_Config.pm).

See the documentation for the RT::Lifecycle module:

my $lifecycle = RT::Lifecycle-Load('default');
my @statuses = $lifecycle-Valid;

probably gets you what you want.  Most of the perl classes that the 
BestPractical guys expect us to use in scripts have reasonable pod 
documentation, although often you have to remember to also consult the 
superclass documentation as well, since sometimes the documentation is at that 
level, in things like RT::Record and RT::SearchBuilder.


and also
the list of names of ticket owners.


Well, you can always construct that from any list of tickets that you've 
previously obtained.  The method is similar to the one mentioned before for 
iterating over queues; instead, you iterate over the tickets and fetch the name 
of the owner from each one.  Note that this is likely to be quite slow if there 
are a lot of tickets.

You could, of course query the database directly, with something like:

select distinct(u.Name) from Users u, Tickets t where t.Owner = u.id;

but querying the database directly is not generally considered a smart thing to 
do, although I doubt this part of the schema is going to change any time soon.


I have looked that the code
that Ruslan mentions but I am able see how to get at the owner
list and list of valid status values.


I find that most of the RT code base itself is usually fairly clear (with the 
exceptions of some of the hairier web interface corners), and when I want to 
find out how to do something in the RT API I just search the main RT code for 
places where the same thing is being done, and copy it!

Regards,

Tim




---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] Perl API: list of available queues, owners, status

2012-07-13 Thread Richard McMahon

OK, I have looked at:

the SelectOwnerDrop template and came up with this which does
what I want to get the list of valid owners:

my $Users = RT::Users-new( RT-SystemUser );
$Users-WhoHaveRight(
Right   = 'OwnTicket',
);

while ( my $Users = $Users-Next ) {
print $Users-Name, \n;
}

Thanks for the pointer

On Thu, 12 Jul 2012, Kevin Falcone wrote:

 Date: Thu, 12 Jul 2012 21:36:55 -0400
 From: Kevin Falcone falc...@bestpractical.com
 Reply-To: rt-users@lists.bestpractical.com
 To: rt-users@lists.bestpractical.com
 Subject: Re: [rt-users] Perl API: list of available queues, owners, status

 On Fri, Jul 13, 2012 at 01:01:05AM +0100, Richard McMahon wrote:
  Is there an API way to get the full list of valid status values and also

 Have you tried running perldoc /opt/rt4/lib/RT/Queue.pm
 and searching for Status?

  the list of names of ticket owners. I have looked that the code

 Look at what the SelectOwner template does to get an owner list.

 -kevin

  that Ruslan mentions but I am able see how to get at the owner
  list and list of valid status values.
 
  thanks
 
 
 
  I know how to this sort of thing with RAW SQL but prefer to try to
  use the API.
 
  I have looked at QueueSummaryByStatus in RT4 but
 
 
  thanks
 
 
  On Thu, 12 Jul 2012, Kevin Falcone wrote:
 
  Date: Thu, 12 Jul 2012 15:00:00 -0400
  From: Kevin Falcone falc...@bestpractical.com
  Reply-To: rt-users@lists.bestpractical.com
  To: rt-users@lists.bestpractical.com
  Subject: Re: [rt-users] Perl API: list of available queues, owners, status
  
  On Thu, Jul 12, 2012 at 07:43:16PM +0100, Richard McMahon wrote:
  I am doing some ASCII perl reports and one of the options is to supply
  the queue name. I want to be able to get a list of the queues that
  are available as an input check.
  
  In that case, it's probably easier to -Load the queue by name and see
  if it exists, rather than list 20 queues and name compare each.
  
  -kevin
  
  
  On Thu, 12 Jul 2012, Ruslan Zakirov wrote:
  
  Date: Thu, 12 Jul 2012 21:30:15 +0300
  From: Ruslan Zakirov r...@bestpractical.com
  To: Richard McMahon r...@ast.cam.ac.uk
  Cc: rt-users@lists.bestpractical.com
  Subject: Re: [rt-users] Perl API: list of available queues, owners, 
  status
  
  On Thu, Jul 12, 2012 at 7:58 PM, Richard McMahon r...@ast.cam.ac.uk 
  wrote:
  Hello,
  
  Is there a way/example of how to get a list of queues, owners, status 
  using
  the Perl API?
  
  I want to cycle through making a list counts for each owner
  and queue by status.
  
  You want count tickets groupped by queue, owner and status, right? You
  really don't want to iterate over anything. It will be very slow.
  Instead take a look at how QueueSummaryBy* files do it in RT 4.0 and
  how RT::Extension::SummaryByUser (on CPAN) does similar task. You just
  need to combine two tables into one big table.
  
 
  ---
   Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
   University of Cambridge   |   (switchboard)   1223-337548
   Institute of Astronomy|   (secretary) 1223-337516
   Madingley Rd  | FAX   1223-337523
   Cambridge, CB3 OHA, UK.   | mobile7885-409019
   Office: Hoyle 18  | home  1223-359770
  ---
   email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
   richardgmcma...@gmail.com | skype:richardgmcmahon
  ---


---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


[rt-users] Perl API: list of available queues, owners, status

2012-07-12 Thread Richard McMahon

Hello,

Is there a way/example of how to get a list of queues, owners, status 
using the Perl API?


I want to cycle through making a list counts for each owner
and queue by status.

Thanks  Richard


---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] Perl API: list of available queues, owners, status

2012-07-12 Thread Richard McMahon


Hi,

I am doing some ASCII perl reports and one of the options is to supply
the queue name. I want to be able to get a list of the queues that
are available as an input check.

r.


On Thu, 12 Jul 2012, Ruslan Zakirov wrote:


Date: Thu, 12 Jul 2012 21:30:15 +0300
From: Ruslan Zakirov r...@bestpractical.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Perl API: list of available queues, owners, status

On Thu, Jul 12, 2012 at 7:58 PM, Richard McMahon r...@ast.cam.ac.uk wrote:

Hello,

Is there a way/example of how to get a list of queues, owners, status using
the Perl API?

I want to cycle through making a list counts for each owner
and queue by status.


You want count tickets groupped by queue, owner and status, right? You
really don't want to iterate over anything. It will be very slow.
Instead take a look at how QueueSummaryBy* files do it in RT 4.0 and
how RT::Extension::SummaryByUser (on CPAN) does similar task. You just
need to combine two tables into one big table.


Thanks  Richard





---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] Perl API: list of available queues, owners, status

2012-07-12 Thread Richard McMahon

OK, that gets me the queue list.

Is there an API way to get the full list of valid status values and also
the list of names of ticket owners. I have looked that the code
that Ruslan mentions but I am able see how to get at the owner
list and list of valid status values.

thanks



I know how to this sort of thing with RAW SQL but prefer to try to
use the API.

I have looked at QueueSummaryByStatus in RT4 but


thanks


On Thu, 12 Jul 2012, Kevin Falcone wrote:


Date: Thu, 12 Jul 2012 15:00:00 -0400
From: Kevin Falcone falc...@bestpractical.com
Reply-To: rt-users@lists.bestpractical.com
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Perl API: list of available queues, owners, status

On Thu, Jul 12, 2012 at 07:43:16PM +0100, Richard McMahon wrote:

I am doing some ASCII perl reports and one of the options is to supply
the queue name. I want to be able to get a list of the queues that
are available as an input check.


In that case, it's probably easier to -Load the queue by name and see
if it exists, rather than list 20 queues and name compare each.

-kevin



On Thu, 12 Jul 2012, Ruslan Zakirov wrote:


Date: Thu, 12 Jul 2012 21:30:15 +0300
From: Ruslan Zakirov r...@bestpractical.com
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Perl API: list of available queues, owners, status

On Thu, Jul 12, 2012 at 7:58 PM, Richard McMahon r...@ast.cam.ac.uk wrote:

Hello,

Is there a way/example of how to get a list of queues, owners, status using
the Perl API?

I want to cycle through making a list counts for each owner
and queue by status.


You want count tickets groupped by queue, owner and status, right? You
really don't want to iterate over anything. It will be very slow.
Instead take a look at how QueueSummaryBy* files do it in RT 4.0 and
how RT::Extension::SummaryByUser (on CPAN) does similar task. You just
need to combine two tables into one big table.




---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


Re: [rt-users] chart by told time

2012-04-16 Thread Richard McMahon


Hi, The Easter Egg Demo sites do not seem to have it.

http://rt.easter-eggs.org/demos/

The footer on the Dashboard for both 4.0 and 4.2

Testing release (4.2 trunk): 4.0.0rc4-22-g4e177bb 
Stable release  (4.0 trunk): 4.0.0rc4-22-g4e177bb


r.

On Mon, 16 Apr 2012, Ruslan Zakirov wrote:


Date: Mon, 16 Apr 2012 19:53:05 +0400
From: Ruslan Zakirov r...@bestpractical.com
To: Christopher Lasater clasa...@taleo.com
Cc: r...@ast.cam.ac.uk r...@ast.cam.ac.uk,
rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Subject: Re: [rt-users] chart by told time

On Mon, Apr 16, 2012 at 19:37, Christopher Lasater clasa...@taleo.com wrote:

Will this be added to a future version of RT, like 4.0.6?


Repo says it's in RT 4.0.5




- Original Message -
From: Ruslan Zakirov [mailto:r...@bestpractical.com]
Sent: Monday, April 16, 2012 10:28 AM
To: Richard McMahon r...@ast.cam.ac.uk
Cc: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Subject: Re: [rt-users] chart by told time

On Sun, Apr 15, 2012 at 22:27, Richard McMahon r...@ast.cam.ac.uk wrote:


Hello,


RT has a time called 'told' or Last Contact time that records the last time
a requestor is contacted. I would like to be able to create charts based on
this time similar to the charts for the other times. The ability to chart by
told/last contact time does not seem to be included in the default set of
charts. I have checked on the RT4.0 Demo site.

(i) Has anyone coded up this option and could share it?

(ii) How would one add the option to an existing installation?

(iii) Could it be added to a future RT release?


It's really very easy to add and master branch has it. You need one
word change 3d2b69c3dc80abbad4278cb171639cd87c82ea6c from RT
repository. We just missed it when added other date fields.



Thanks Richard





---
 Dr. Richard G. McMahon    | Phone (office)     44-(0)-1223-337519
 University of Cambridge   |       (switchboard)       1223-337548
 Institute of Astronomy    |       (secretary)         1223-337516
 Madingley Rd              | FAX                       1223-337523
 Cambridge, CB3 OHA, UK.   | mobile                    7885-409019
 Office: Hoyle 18          | home                      1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:    http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:                richardgmcmahon
---




--
Best regards, Ruslan.







--
---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---

Re: [rt-users] chart by told time

2012-04-16 Thread Richard McMahon


Thanks, Charts by Told Time are available. r.


On Mon, 16 Apr 2012, Emmanuel Lacour wrote:


Date: Mon, 16 Apr 2012 18:48:09 +0200
From: Emmanuel Lacour elac...@easter-eggs.com
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] chart by told time

On 16/04/2012 18:32, Emmanuel Lacour wrote:

On 16/04/2012 18:11, Richard McMahon wrote:


Hi, The Easter Egg Demo sites do not seem to have it.

http://rt.easter-eggs.org/demos/




yes, this is pretty outdated :(

I'm going to update this soon ... lack of times those days/weeks/months :(



4.0 demo is now at current git 4.0-trunk.



--
---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


[rt-users] chart by told time

2012-04-15 Thread Richard McMahon


Hello,


RT has a time called 'told' or Last Contact time that records the last 
time a requestor is contacted. I would like to be able to create charts 
based on this time similar to the charts for the other times. The ability 
to chart by told/last contact time does not seem to be included in the 
default set of charts. I have checked on the RT4.0 Demo site.


(i) Has anyone coded up this option and could share it?

(ii) How would one add the option to an existing installation?

(iii) Could it be added to a future RT release?

Thanks Richard





---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---


[rt-users] RT boilerplate error: Log file '/local/rt3/var/log/rt.log' couldn't be written or created

2012-02-24 Thread Richard McMahon


I am trying to run some RT queries using the RT boilerplate
from the O' Reilly All About RT presentation page 188 by Jesse Vincent
as a normal user on a existing RT installation.


#!/usr/bin/perl -w
use strict;
use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
use RT;
# Load the config file
RT::LoadConfig();
# Connect to the database and get RT::SystemUser
# loaded
RT::Init();


This produces the error.

Log file '/local/rt3/var/log/rt.log' couldn't be written or created.
 RT can't run. at /local/rt3/lib/RT.pm line 318.

Is there a way to change the location of the of rt.log from within a perl 
script. I do not have root priveledges and only want read access for

queries using the API.

Thanks Richard


---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---

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


Re: [rt-users] RT boilerplate error: Log file '/local/rt3/var/log/rt.log' couldn't be written or created

2012-02-24 Thread Richard McMahon




This produces the error.

Log file '/local/rt3/var/log/rt.log' couldn't be written or created.
 RT can't run. at /local/rt3/lib/RT.pm line 318.

Is there a way to change the location of the of rt.log from within a perl
script. I do not have root priveledges and only want read access for
queries using the API.


 I do not know if this helps, but in RT_SiteConfig.pm you could
set, for instance,

Set($LogDir,'/tmp/');
Set($LogToFileNamed, 'rt.log');

or wherever it needs to go. About /local/rt3/var/log/rt.log, I wonder
who owns /local/rt3/var/log.




thanks

on our system:

/local/rt3/var/log/rt.log is owned by apache

/local/rt3/etc/RT_Config.pm and
/local/rt3/etc/RT_SiteConfig.pm are owned by root

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

Re: [rt-users] Doing response-time analytics

2011-09-29 Thread Richard McMahon



Started: Tue, Aug 16, 2011 3:02:18 PM


Hi,

It looks to me that Started is updated when the ticket is taken or any
transaction to the ticket. e.g. queue change

This time is not the time for first response with a requestor

Is there a recommended way to record the 'first contact/response' time
without analyzing the transactions?

r.

On Wed, 28 Sep 2011, Francisco Jen Ou wrote:


Date: Wed, 28 Sep 2011 16:45:10 -0300
From: Francisco Jen Ou fje...@intercomti.com.br
To: Jason Ketola jket...@maxmind.com
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Doing response-time analytics

Hi,

If you have access to RT server console, you can run this command:

/opt/rt4/bin/rt show -l ticket/ticket_number

which will give you detailed data and these 2 interesting fields:

...
Created: Tue, Aug 16, 2011 3:00:37 PM
...
Started: Tue, Aug 16, 2011 3:02:18 PM



Em 28-09-2011 16:19, Jason Ketola escreveu:

Hi,

I'm trying to figure out how to do analytics on response times to
messages. That is, I want to be able to graph, for instance, how long
it's taking on average for messages hitting our queue to get a response
(I'm not looking for time to resolution). From what reading I've done,
it seems like I'll need to create a custom field to do this, right? Or
is there somewhere else I should look?

Thank you!
Jason




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



---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---

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] search for tickets with Date or Told Not set

2011-09-23 Thread Richard McMahon


As suggested by Kevin I created an Issue in the RT issue system.

Following some dialogue within the issue system with
Ruslan Zakirov the following is a summary of the situation and
my proposed solution which might be of interest to others. I
would welcome comments and advice.

It looks like the Told time incorrectly IMHO has a default value of Null 
whereas the other times have a default time of 1970-01-01 00:00:00 which 
is Unix/Posix time = 0. This effects RT4 as well since the 'bug'

effects queries in RT on the Demo site.

There might be good reasons for the above feature.

I see two possible solutions:
(i) NULL support for Times in TicketSQL [mentioned by by Kevin Falcone]

This requires someone to do it and is not a breaking change.

(ii) Change the default value for Told time to be the same as
the other times. This might break existing scripts but is a short
term fix. It also makes all times the same.

I welcome opinions on this proposal below e.g. is it likely
to break other extensions e.g. SLA

Updating existing tickets
UPDATE tickets SET Told='1970-01-01 00:00:00' WHERE told is null;

This 'fixes' existing tickets.

This then changes the default in the Table:

ALTER TABLE Tickets COLUMN Told SET DEFAULT='1970-01-01 00:00:00'

Thanks Richard

On Fri, 9 Sep 2011, Kevin Falcone wrote:


Date: Fri, 9 Sep 2011 11:21:34 -0400
From: Kevin Falcone falc...@bestpractical.com
Reply-To: rt-users@lists.bestpractical.com
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] search for tickets with Date or Told Not set

On Fri, Sep 09, 2011 at 03:34:28PM +0100, Richard McMahon wrote:

Hello,

I would like to search for tickets with Last Contact: Not
set. i.e Told = 'Not set' or Told IS NULL in the query builder.

Neither of the above return any tickets. This is an issues in RT 3.8
and I can reproduce the issues with the demo sites that run 4.0 and
4.2.

The issue is part of specific query which is intended to check for
tickets which have not had requestor contact for a week.

i.e. Told  '-7 days'

The above does not return the ticket where there has been no
contact with the requestor by the owner since Last Contact: Not set

I have searched this list, wiki and google without success.


As I believe I mentioned on #rt when you asked this question, the
TicketSQL parser only accepts a few operators on Date fields.

   die Invalid Date Op: $op
   unless $op =~ /^(=|||=|=)$/;

If you read your logs, you should be seeing:
[Fri Sep  9 15:19:08 2011] [error]: Invalid Date Op: IS

You can file a feature request in the bug tracker:
http://bestpractical.com/rt/issues.html

-kevin



---
 Dr. Richard G. McMahon| Phone (office) 44-(0)-1223-337519
 University of Cambridge   |   (switchboard)   1223-337548
 Institute of Astronomy|   (secretary) 1223-337516
 Madingley Rd  | FAX   1223-337523
 Cambridge, CB3 OHA, UK.   | mobile7885-409019
 Office: Hoyle 18  | home  1223-359770
---
 email: r...@ast.cam.ac.uk  | WWW:http://www.ast.cam.ac.uk/~rgm
 richardgmcma...@gmail.com | skype:richardgmcmahon
---

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] search for tickets with Date or Told Not set

2011-09-09 Thread Richard McMahon

Hello,

I would like to search for tickets with Last Contact: Not
set. i.e Told = 'Not set' or Told IS NULL in the query builder.

Neither of the above return any tickets. This is an issues in RT 3.8 and I 
can reproduce the issues with the demo sites that run 4.0 and 4.2.


The issue is part of specific query which is intended to check for
tickets which have not had requestor contact for a week.

i.e. Told  '-7 days'

The above does not return the ticket where there has been no
contact with the requestor by the owner since Last Contact: Not set

I have searched this list, wiki and google without success.

Thanks Richard

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