[rt-users] FW: Cloning an existing ticket

2013-06-11 Thread Brent Wiese
> On Mon, Jun 03, 2013 at 09:52:24PM +, Brent Wiese wrote:
> >I'm running RT 4.0.10.
> >
> >I tried installing rt-extension-cloneticket-withdata. It looks
> like that hasn't been updated
> >in a while - not since rt 4 anyways.
> >
> >When I try cloning a ticket, I get:
> >
> >RT: Not an ARRAY reference at
> >/opt/rt4/local/plugins/RT-Extension-CloneTicket-
> WithData/html/Ticket/Clone/index.html line
> >183.#012#012Stack:#012
> >[/opt/rt4/local/plugins/RT-Extension-CloneTicket-
> WithData/html/Ticket/Clone/index.html:183]#012
> >[/opt/rt4/share/html/Ticket/autohandler:66]#012
> >[/opt/rt4/sbin/../lib/RT/Interface/Web.pm:634]#012
> >[/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]#012
> [/opt/rt4/share/html/autohandler:53]
> >(/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:208)
> >
> 
> Yep - that's a change between 3.8 and 4.0.
> 
> The Queue cache is stored in $session{$cache_key}{queues} rather than
> directly under the cache key.  Should be a simple enough change to the
> module to get past that error.  If that fixes it for you, send a pull
> request?
> 
> -kevin

Made the above change (think it was in 4 places) in the index.html file (only 
one I found with that line) and now I get:

[Tue Jun 11 22:59:49 2013] [error]: could not find component for path 
'/Ticket/Elements/Tabs'

Stack:
  
[/opt/rt4/local/plugins/RT-Extension-CloneTicket-WithData/html/Ticket/Clone/index.html:50]
  [/opt/rt4/share/html/Ticket/autohandler:66]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:634]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]
  [/opt/rt4/share/html/autohandler:53] 
(/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:208)

That path is actually to a Callbacks file included with the plugin, which 
appears to function since it's what adds the "clone" link to the ticket, which 
is there, because I get the error after clicking it.

Any ideas? This is beyond my programming level. If it's not a quick fix, I'll 
probably have to ditch it (or hope the original author sees this and updates 
the module).

Thanks!



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


[rt-users] Exporting ticket info including CFs, history and attachments

2013-06-11 Thread Jeff Lucas
Hello folks.

I am looking to export RT ticket info to a comma or tab-delimited file.  
Another output format would be acceptable, if necessary.

Currently, I select all tickets with ticket ID less than 10 (we only have 
~25000 tickets so that should get all of them) in the query builder page and 
include all columns.  What is missing is custom field data as well as ticket 
history and attachments.

Would greatly appreciate if someone could provide guidance around capturing all 
ticket info in the output file.

Thank you.

-Jeff



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


Re: [rt-users] REST vs GUI: huge performance diference

2013-06-11 Thread Thomas Sibley
On 06/11/2013 01:42 PM, Ram wrote:
> Hey folks. I'm using rt 4.02 via REST and I noticed a surprising
> difference in performance between using the RT web GUI where a certain
> query takes less than one second and the RT command line where the same
> query takes close to four seconds.
> 
> rt ls 'requestor=someu...@example.com '
>  (takes 3+ seconds)
> rt web UI quick search for someu...@example.com
>  (takes < 1 second)
> 
> That user has 133 tickets. If I do this for a user with 6 tickets then
> both methods are essentially instant.
> 
> What's going on here?

Allow me to paste from #rt:

14:00 <@trs> ram: the quick search on the web automatically limits to active 
 statuses.
14:00 <@trs> ram: `rt ls` doesn't if you specify a query
14:00 <@trs> try `rt ls 'requestor=someu...@example.com and (status=new or 
 status=open or status=stalled)'`
14:00 <@trs> or similar

Please wait a reasonable time for a response before asking in multiple mediums.


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


[rt-users] REST vs GUI: huge performance diference

2013-06-11 Thread Ram
Hey folks. I'm using rt 4.02 via REST and I noticed a surprising difference
in performance between using the RT web GUI where a certain query takes
less than one second and the RT command line where the same query takes
close to four seconds.

rt ls 'requestor=someu...@example.com'  (takes 3+ seconds)
rt web UI quick search for someu...@example.com (takes < 1 second)

That user has 133 tickets. If I do this for a user with 6 tickets then both
methods are essentially instant.

What's going on here?

thanks!
ram


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

Re: [rt-users] Any way to automatically bulk generate tickets?

2013-06-11 Thread k...@rice.edu
On Tue, Jun 11, 2013 at 04:32:11PM -0400, Chris Hall wrote:
> I have a rather unique situation here.  Without going into background, I
> need to make a couple thousand RT tickets.  There's not alot of
> information... name, phone number, address, etc etc.  I was wondering if
> there was some way I could dump this into either a text file or a
> spreadsheet, and then run it through RT and generate new tickets based on
> that data.  Does anybody have any ideas on if this is possible, or know of
> any extensions that might work?

Hi Chris,

Take a look at Tools->Offline.  You can submit a correctly formatted text
file and create multiple tickets. Just figure out the template for 1 and
then create as many as you wish. I had no issues using it for several
thousand tickets at a time.

Regards,
Ken


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


[rt-users] Any way to automatically bulk generate tickets?

2013-06-11 Thread Chris Hall
I have a rather unique situation here.  Without going into background, I
need to make a couple thousand RT tickets.  There's not alot of
information... name, phone number, address, etc etc.  I was wondering if
there was some way I could dump this into either a text file or a
spreadsheet, and then run it through RT and generate new tickets based on
that data.  Does anybody have any ideas on if this is possible, or know of
any extensions that might work?


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

Re: [rt-users] RT MAX TICKET ID

2013-06-11 Thread k...@rice.edu
On Tue, Jun 11, 2013 at 03:57:00PM -0400, romain.peliss...@bell.ca wrote:
> Hi,
> Maybe that sound as a stupid question but can you tell me what is the MAX 
> value for a ticket ID? Is there a end-of-the-world ticket id limit?
> I have been asked for this question and pretty sure that at 10 it will 
> still works but can find a way to confirm this.
> If anyone can tell me it will be greatly appreciated.
> Thanks!
> 
> Romain Pelissier

Hi Romain,

According to the DB schema for PostgreSQL the ticket ID is defined to be
an integer which in SQL has a maximum of (2^31 - 1) which is the max. You
would need to log a lot of tickets to reach that. I do not know if there
are coding assumptions within RT that would preclude increasing that to
a bigint with a max of (2^63 -1).

Cheers,
Ken


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


[rt-users] RT MAX TICKET ID

2013-06-11 Thread romain.peliss...@bell.ca
Hi,
Maybe that sound as a stupid question but can you tell me what is the MAX value 
for a ticket ID? Is there a end-of-the-world ticket id limit?
I have been asked for this question and pretty sure that at 10 it will 
still works but can find a way to confirm this.
If anyone can tell me it will be greatly appreciated.
Thanks!


Romain Pelissier



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


[rt-users] Custom Field search - dynamically modify query string

2013-06-11 Thread Andy Harrison
This seems rather unlikely, but I wanted to ask just in case someone
knows a simple way this could be done.

I have a custom field containing mac address values and I store them
without the : colon characters.  Is there a simple way, (maybe a
callback or _Local overlay or something), where I could make it so
that if someone tries to search by that custom mac address field, that
I strip out any colons before performing the search?

Thanks,


--
Andy Harrison
public key: 0x67518262


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


Re: [rt-users] Add Attachments to Custom Template

2013-06-11 Thread globo
thanks Ruslan for the link. 

I made the changes and now I get the images as
[cid:image001.jpg@018998C2.1ErttE250] in the email notifications. Is there
anyway to get the images to attached to the email or to get the image to
display correctly ? 



--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Add-Attachments-to-Custom-Template-tp54247p54251.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


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


Re: [rt-users] Add Attachments to Custom Template

2013-06-11 Thread Ruslan Zakirov
Have you seen the following?

http://requesttracker.wikia.com/wiki/Template#Attaching_original_attachments_to_the_mail


On Tue, Jun 11, 2013 at 8:12 PM, globo wrote:

> Hi,
>
> I have a template that emails a group when a ticket changes queue with the
> details of the request. I need to add the attachments to the email, but I
> cant figure out whats required to add the attachments.
>
>
> ---
>
> Condition : On Queue Change
> Action  : Notify Other Recipients
> Template :  "My Template Name"
> Stage  : Transaction Create
>
> --
>
>
> Template - "My Template Name"
> 
>
> To: { my $group = RT::Group->new( $RT::SystemUser );
> $group->LoadUserDefinedGroup("My Group");
> $group->MemberEmailAddressesAsString; }
>
> {$Ticket->Transactions->First->Content()}
>
> -
>
> Anyone have a script that adds attachments ?
>
> Any help much appreciated.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://requesttracker.8502.n7.nabble.com/Add-Attachments-to-Custom-Template-tp54247.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
>
>
> --
> RT Training in Seattle, June 19-20: http://bestpractical.com/training
>



-- 
Best regards, Ruslan.


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

[rt-users] Add Attachments to Custom Template

2013-06-11 Thread globo
Hi, 

I have a template that emails a group when a ticket changes queue with the
details of the request. I need to add the attachments to the email, but I
cant figure out whats required to add the attachments. 


---

Condition : On Queue Change 
Action  : Notify Other Recipients 
Template :  "My Template Name" 
Stage  : Transaction Create 

--


Template - "My Template Name" 


To: { my $group = RT::Group->new( $RT::SystemUser );
$group->LoadUserDefinedGroup("My Group");
$group->MemberEmailAddressesAsString; }

{$Ticket->Transactions->First->Content()}

-

Anyone have a script that adds attachments ?

Any help much appreciated.  







--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Add-Attachments-to-Custom-Template-tp54247.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


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


Re: [rt-users] For RTIR are scrips ran before plugins? (namely lib/RT/Action/RTIR_FindIP.pm)

2013-06-11 Thread Ruslan Zakirov
On Tue, Jun 11, 2013 at 1:05 AM, Landon  wrote:

> On 6 June 2013 15:36, Landon  wrote:
>
>> On 6 June 2013 13:23, Ruslan Zakirov  wrote:
>>
>>> yes, use SQL to check:
>>>
>>> select Description from Scrips order by Description;
>>>
>>> [RTIR] prefix is also accounted, so you have to know where DB places it
>>> while sorting.
>>>
>>
>> Thank you that makes sense.  I still have a bit of an issue with the
>> order of things.  If I use "On Create" as the condition the scrip fires
>> earlier than the order by Description and there are no IP addresses in the
>> custom field at that point.  If I use a User Defined condition the IP
>> address custom field is already populated by that time.  The problem with
>> using a User Defined condition is that it has the potential to fire more
>> than once if I base it on something to do with the ticket that might happen
>> more than once in the ticket's life.  I only want to do this process once
>> on the original content of the ticket so On Create makes the most sense.
>>
>> Any idea how I can get a condition that that will only fire once per
>> ticket on creation or otherwise but going by the order of scrips that
>> indicated by the SQL query?
>>
>
> If anyone has any information on this I would appreciate it. Basically I'm
> looking for a condition that *only* fires once per ticket creation but late
> enough in the ticket creation process that all the custom fields have
> already been updated by RTIR built-in scrips (ie. ticket already commited
> to database?).
>

http://requesttracker.wikia.com/wiki/CustomConditionSnippets#When_Custom_Field_.27X.27_is_set_to_.27A.27



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



-- 
Best regards, Ruslan.


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

Re: [rt-users] Change the Forward Template

2013-06-11 Thread globo
Hi Ruslan, 

Could you send me on details of how to do this. Im abit of a newbie. 


Thanks 





--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Change-the-Forward-Template-tp54240p54242.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


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


Re: [rt-users] Change the Forward Template

2013-06-11 Thread Ruslan Zakirov
Hi,

To change what gets forwarded you should override forward action, not
template.


On Tue, Jun 11, 2013 at 4:09 PM, globo wrote:

> Hi,
>
> Does anyone know if its possible to change the Forward template ?
>
> If I go to the Action Button and Select forward I enter a email address and
> the email get sent with a attachment with the ticket details
>
> I would like to remove the attachment and just have the details of the
> ticket attached.
>
>
>
>
>
>
> --
> View this message in context:
> http://requesttracker.8502.n7.nabble.com/Change-the-Forward-Template-tp54240.html
> Sent from the Request Tracker - User mailing list archive at Nabble.com.
>
>
> --
> RT Training in Seattle, June 19-20: http://bestpractical.com/training
>



-- 
Best regards, Ruslan.


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

[rt-users] Change the Forward Template

2013-06-11 Thread globo
Hi, 

Does anyone know if its possible to change the Forward template ? 

If I go to the Action Button and Select forward I enter a email address and
the email get sent with a attachment with the ticket details 

I would like to remove the attachment and just have the details of the
ticket attached. 






--
View this message in context: 
http://requesttracker.8502.n7.nabble.com/Change-the-Forward-Template-tp54240.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


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


[rt-users] Some searches produce tickets with incorrect links

2013-06-11 Thread Gary Mason

Hi,

I have successfully migrated my RT database from 3.6.7 to 4.0.7 on 
Debain Wheezy and Postgresql 9.2.


Everything is looking good with the exception of the following problem I 
have found.


If I do a search with the following criteria in the New Search query 
builder screen, then I get a results page that works fine - the links to 
tickets are formatted correctly.


Queue = 'Abroad'
AND Status = 'new'

Each ticket has a link such as :- 
https://rt4.mydomain.com/Ticket/Display.html?id=324944 where clicking on 
it displayed the ticket information.


If I now slightly amend the search to the following criteria:

Queue = 'Abroad'
AND (
  Status = 'new'
  OR Status =  'open')

then the results screen offers ticket results with an incorrect link :- 
https://rt4.mydomain.com/rt/Ticket/Display.html?id=324944


Note the extra "/rt" after the domain name.  Clicking on these links 
goes to my page not found processing on nginx, ie back to the login page.


Clicking on the Advanced menu bar link shows the format of the output, 
and each time, the '

Set ($DefaultSearchResultFormat, qq{
   'HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__/TITLE:#',
   'HREF="__WebPath__/Ticket/Display.html?id=__id__">__Subject__/TITLE:Subject',

   Status,
   QueueName,
   OwnerName,
   Priority,
   '__NEWLINE__',
   '',
   '__Requestors__',
   '__CreatedRelative__',
   '__ToldRelative__',
   '__LastUpdatedRelative__',
   '__TimeLeft__'});

What is causing this issue with certain search criteria ?  On previous 
tests with this particular setup, but without the migrated ticket 
information, these searches always worked fine.


Hoping someone knows ..

Gary



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


Re: [rt-users] RES: Is it possible to specify a different user with RT CLI ?

2013-06-11 Thread Jean-Christophe Boggio
Ok, I did it and it seems to work like I want it to. There are still 
things that I don't understand but they might be related to my lack of 
Perl knowledge, for example : why can't I find the declaration for 
RT::User->new or RT::Ticket->new ?



For the record I did this :

use lib qw(/usr/share/request-tracker4/lib);

use RT;
use RT::Ticket;
use RT::User;

RT->LoadConfig();
RT->Init();

# 140 is my test user (the one I'm impersonating)
my $User = RT::User->new();
$User->Load(140);
die "User 140 not found" unless $User->id;

# As I understand it, RT's $TicketObj->new expects a RT::User parameter
# which will be the "CurrentUser"
# This user must have rights to comment/correspond in the ticket's queue
# Our system does not use queues to determine who can write/comment/...
# It is rather based on (recursive) assets (organization/Administrative
# entity/Site) so I take care of the ACL by myself.
# I chose to give all permissions to all users in RT's queues.
# I probably could have rather used :
#   $RT::Handle->BeginTransaction();
#   $Ticket->_RecordNote(%args);
#   $RT::Handle->Commit();

# 3 is my test ticket

my $Ticket = RT::Ticket->new( $User );
$Ticket->Load(3);
die "Ticket 3 not found" unless $Ticket->id;

$Ticket->Comment(
Content => "This is a test"
);



As a side note, the RT->Init() is very long, mainly because of 
RT::I18N->Init()


Since I don't need internationalization, I copied what RT::Init does and 
commented out the I18N part :


RT::CheckPerlRequirements();
RT::InitPluginPaths();
RT::ConnectToDatabase();
RT::InitSystemObjects();
RT::InitClasses();
RT::InitLogging();
RT::InitPlugins();
#   RT::I18N->Init;
RT->Config->PostLoadCheck;

Hope this helps. I'd be glad to create a wiki page describing this but 
I'm not too confident in my understanding of how RT core works. However, 
if someone validates it, I'll do it.


Thanks again to those who helped.



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