Re: [rt-users] RT-Authen-ExternalAuth plugin causes 'Can't locate Apache.pm in @INC' issue

2012-02-02 Thread Srikumar Nair
Thanks Bart.

User interface is not affected. Only Php/Perl code execution.


On Feb 1, 2012, at 11:32 PM, Bart b...@pleh.infomailto:b...@pleh.info 
wrote:

Are you only getting the errors when executing the custom PHP/Perl code? Or 
does this also affect RT's user interface/functionality?

-- Bart


Op 2 februari 2012 02:33 schreef Srikumar Nair 
srikum...@fb.commailto:srikum...@fb.com het volgende:


We have a RT 4.0.4 installation running on Apache.
We have some front end PHP code that calls Perl scripts which use Perl RT APIs 
for RT interactions.

Recently we installed the RT-Authen-ExternalAuth plugin (version 0.09) to RT.
This creates the the following error when ever the php tries to invoke the perl 
scripts.
But if I remove the plugin from the RT_SiteConfig.pm file everything works fine 
again.

Has anyone see this issue?


Can't locate Apache.pm in @INC (@INC contains: /opt/rt4/local/lib 
/opt/rt4/local/plugins/RT-Site-Facebook-TicketPageMenu/lib 
/opt/rt4/local/plugins/RT-Site-Facebook-SetQueue/lib 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib 
/opt/rt4/local/plugins/RT-Extension-ArticleTemplates/lib /opt/rt4/lib 
/opt/rt4/share/html/fb/perl 
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl 
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl 
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at 
/usr/lib/perl5/5.8.8/CGI/Cookie.pm line 38, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI/Cookie.pm
 line 3, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI/Cookie.pm
 line 3, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI.pm 
line 4, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI.pm 
line 4, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm 
line 27, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm 
line 27, DATA line 558.

Thanks a bunch.




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


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

[rt-users] RT-Authen-ExternalAuth plugin causes 'Can't locate Apache.pm in @INC' issue

2012-02-01 Thread Srikumar Nair


We have a RT 4.0.4 installation running on Apache.
We have some front end PHP code that calls Perl scripts which use Perl RT APIs 
for RT interactions.

Recently we installed the RT-Authen-ExternalAuth plugin (version 0.09) to RT.
This creates the the following error when ever the php tries to invoke the perl 
scripts.
But if I remove the plugin from the RT_SiteConfig.pm file everything works fine 
again.

Has anyone see this issue?


Can't locate Apache.pm in @INC (@INC contains: /opt/rt4/local/lib 
/opt/rt4/local/plugins/RT-Site-Facebook-TicketPageMenu/lib 
/opt/rt4/local/plugins/RT-Site-Facebook-SetQueue/lib 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib 
/opt/rt4/local/plugins/RT-Extension-ArticleTemplates/lib /opt/rt4/lib 
/opt/rt4/share/html/fb/perl 
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl 
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl 
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at 
/usr/lib/perl5/5.8.8/CGI/Cookie.pm line 38, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI/Cookie.pm
 line 3, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI/Cookie.pm
 line 3, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI.pm 
line 4, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI.pm 
line 4, DATA line 558.
Compilation failed in require at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm 
line 27, DATA line 558.
BEGIN failed--compilation aborted at 
/opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth.pm 
line 27, DATA line 558.

Thanks a bunch.



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

[rt-users] Selecting Queues Dynamically with Perl API in 4.0.2

2011-10-27 Thread Srikumar Nair
I have setup the Queue with a custom field called 'Country' and created a queue 
with country populated with 'United States'.

Then, I am using the following code snippet to select this Queue based on the 
custom Country field value in Queue.

$cfCountryQ = RT::CustomField-new(RT-SystemUser);
$cfCountryQ-LoadByName(Name = 'Country');

$splQueues = RT::Queues-new(RT-SystemUser);
$splQueues-LimitCustomField (CustomField = $cfCountryQ-id, Value = 'United 
States');

while (my $splQueue = $splQueues-Next) {
  print (inside the loop\n);
  print ($splQueue-Name);
}

The control does not go inside the loop. I am wondering what is that I am doing 
wrong here..

~
~
~
~
~

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] Adding custom field to the Queue object thru initial data script (4.0.2)

2011-10-26 Thread Srikumar Nair
Thanks Kevin..

I got that suggestion (Queue = 0) from Ruslan for another question.

BTW, back to my original question..

I am trying to create a custom field on the Queue object with the initial
data script, which has the following entry:

{
Name= 'Country',
Type= 'SelectSingle',
LookupType  = 'RT::Queue',
Disabled= 0,
Queue   = 0,
Description = 'Country information is used to identify country
specific queues',
},

My assumption is specifying the LookupType as 'RT::Queue' will make it add
it to the Queue object. But this gets added to the Ticket object.

How do I add custom field to Queue Object?


Thanks



On 10/26/11 3:09 PM, Kevin Falcone falc...@bestpractical.com wrote:

On Fri, Oct 21, 2011 at 10:42:43PM +, Srikumar Nair wrote:
I am trying to create a custom field on the Queue object with the
initial data script, which
has the following entry:
Queue   = 0,

Don't pass this line, it'll cause Custom Field to make some bad
backwards-compatibility decisions

-kevin

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] Adding custom field to the Queue object thru initial data script (4.0.2)

2011-10-26 Thread Srikumar Nair
That is perfect. That did the trick..

On 10/26/11 3:24 PM, Kevin Falcone falc...@bestpractical.com wrote:

On Wed, Oct 26, 2011 at 10:20:24PM +, Srikumar Nair wrote:
 I got that suggestion (Queue = 0) from Ruslan for another question.

Correct, it applies to Ticket Custom Fields, which is the question
Ruslan was answering.

 BTW, back to my original question..
 
 I am trying to create a custom field on the Queue object with the
initial
 data script, which has the following entry:
 
 {
 Name= 'Country',
 Type= 'SelectSingle',
 LookupType  = 'RT::Queue',
 Disabled= 0,
 Queue   = 0,
 Description = 'Country information is used to identify country
 specific queues',
 },
 
 My assumption is specifying the LookupType as 'RT::Queue' will make it
add
 it to the Queue object. But this gets added to the Ticket object.
 
 How do I add custom field to Queue Object?

Remove Queue = 0 from the code you've pasted.

-kevin

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] Adding custom field to the Queue object thru initial data script (4.0.2)

2011-10-24 Thread Srikumar Nair
Has anyone tried to add custom fields to the Queue object (or any other Ticket 
objects) thru the initial data scripts (which will be run with the 
$RT_HOME/sbin/rt-setup-database command)?

Also, is there a place where I can find the list of different Types I can use 
in script?
Basically these should correspond to various drop down values for Type in the 
web UI where you define the Custom Fields.

Thanks again..


I am trying to create a custom field on the Queue object with the initial data 
script, which has the following entry:

{
Name= 'Country',
Type= 'SelectSingle',
LookupType  = 'RT::Queue',
Disabled= 0,
Queue   = 0,
Description = 'Country information is used to identify country 
specific queues',
},

My assumption is specifying the LookupType as 'RT::Queue' will make it add it 
to the Queue object. But this gets added to the Ticket object.
How do I add custom field to the Queue object thru the initial data scripts?

Thanks
Srikumar

 RT Training Sessions (http://bestpractical.com/services/training.html) 
* Washington DC, USA ˜ October 31  November 1, 2011 * Barcelona, Spain ˜ 
November 28  29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] Displaying custom field with Ticket API

2011-10-23 Thread Srikumar Nair
Great. That works nicely.

Thanks Ruslan.

From: Ruslan Zakirov r...@bestpractical.commailto:r...@bestpractical.com
Date: Sat, 22 Oct 2011 15:05:12 +0400
To: Srikumar Nair srikum...@fb.commailto:srikum...@fb.com
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com 
rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Displaying custom field with Ticket API


Use FirstCustomFieldValue method.

Regards, Ruslan. From phone.

22.10.2011 0:54 пользователь Srikumar Nair 
srikum...@fb.commailto:srikum...@fb.com написал:
We have a Global custom field called Search_Criteria in Ticket object.
I am using the following code snippet to display this Search_Criteria in the 
tickets.

Apparently the print line is not correct; but after searching the mailing lists 
and the wiki I cannot find the correct way to do this.
What is the correct way here?

my $ticketSql = Requestor.Name = '$requestor';

my $tickets4Requestor = RT::Tickets-new(RT-SystemUser);
$tickets4Requestor-FromSQL($ticketSql);

while (my $request = $tickets4Requestor-Next ) {
   print $request-CF.{Search_Criteria} . \n;   ### == problem line.
}


Thanks
Srikumar



RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

[rt-users] creation initial data with rt-setup-database (4.0.2)

2011-10-21 Thread Srikumar Nair
I am using the following entry in the initial data file to create a custom 
field:

@CustomFields = (
{
Name= 'Search_Criteria',
Type= 'FreeformSingle',
Disabled= 0,
Description = 'Search Criteria',
}
)

* When looking at this custom field in the RT UI in the advance tab I get the 
message Something wrong. Contact system administrator.  What I am I doing 
wrong here?
* Also, what option do I specify to make this a global one which is applicable 
to all the tickets?

Thanks
Srikumar


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] creation initial data with rt-setup-database (4.0.2)

2011-10-21 Thread Srikumar Nair
Perfect. That took care of both the issues.

BTW, what is the URL for me to file bugs in RT?

On 10/21/11 1:01 PM, Ruslan Zakirov r...@bestpractical.com wrote:

On Fri, Oct 21, 2011 at 11:02 PM, Srikumar Nair srikum...@fb.com wrote:
 I am using the following entry in the initial data file to create a
custom
 field:
 @CustomFields = (
 {
 Name= 'Search_Criteria',
 Type= 'FreeformSingle',
 Disabled= 0,
 Description = 'Search Criteria',
 }
 )
 * When looking at this custom field in the RT UI in the advance tab I
get
 the message Something wrong. Contact system administrator.
 What I am I
 doing wrong here?

When you see such message, you have more descriptive message in the logs.

 * Also, what option do I specify to make this a global one which is
 applicable to all the tickets?

If you add Queue = 0, then probably you'll kill both rabbits.

Please file a bug report saying that above structure in initialdata
file result in an invalid custom field. Create method in
RT::CustomField should do better job at validating its input.

 Thanks
 Srikumar

-- 
Best regards, Ruslan.


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


[rt-users] Displaying custom field with Ticket API

2011-10-21 Thread Srikumar Nair
We have a Global custom field called Search_Criteria in Ticket object.
I am using the following code snippet to display this Search_Criteria in the 
tickets.

Apparently the print line is not correct; but after searching the mailing lists 
and the wiki I cannot find the correct way to do this.
What is the correct way here?

my $ticketSql = Requestor.Name = '$requestor';

my $tickets4Requestor = RT::Tickets-new(RT-SystemUser);
$tickets4Requestor-FromSQL($ticketSql);

while (my $request = $tickets4Requestor-Next ) {
   print $request-CF.{Search_Criteria} . \n;   ### == problem line.
}


Thanks
Srikumar


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

[rt-users] Adding custom field to the Queue object thru initial data script (4.0.2)

2011-10-21 Thread Srikumar Nair
I am trying to create a custom field on the Queue object with the initial data 
script, which has the following entry:

{
Name= 'Country',
Type= 'SelectSingle',
LookupType  = 'RT::Queue',
Disabled= 0,
Queue   = 0,
Description = 'Country information is used to identify country 
specific queues',
},

My assumption is specifying the LookupType as 'RT::Queue' will make it add it 
to the Queue object. But this gets added to the Ticket object.
How do I add custom field to the Queue object thru the initial data scripts?

Thanks
Srikumar


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

[rt-users] Perl way to select Queues based on condition (4.0.2).

2011-10-19 Thread Srikumar Nair
I have a Custom Field on the Queue object called 'Support Level' with various 
support levels (Different Queue for different support levels)
How can I choose the Queue (with Perl APIs) based on the Support Level I 
receive as input?

I want to assign the Ticket to the correct queue during Ticket creation (BTW, I 
create Tickets with Perl APIs).

Does any one has some Perl code snippets that uses the RT APIs?

Thanks a bunch..


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] Setting Custom Field during Ticket creation in Perl API (4.0.2)

2011-10-18 Thread Srikumar Nair
retrying.. I am pretty sure there is someone in the community who can tell me 
what I am doing wrong ..



I am trying to set a Custom Field Value during the creation of a ticket with 
the following piece of code. But the value (SN-1234) is not getting added to 
custom field
(BTW, I already pre created the Custom Field for the Ticket object and made it 
Global).

What am I doing wrong? Is SetIncludeContentForValue the correct API call?

=
my $cf = RT::CustomField-new($RT::SystemUser);
$cf-Load('Store Number');

unless ($cf-id) {
  $RT::Logger-error( Couldn't load custom field  . Store Number);
}

$cf-SetIncludeContentForValue (SN-1234);

@retValues = $ticket-Create( Queue = 'My Store Queue', Subject = 'Test 
Ticket for Store 1234 ', CustomField = $cf);
=

Thanks


~
~
~
~
 RT Training Sessions (http://bestpractical.com/services/training.html) 
* Washington DC, USA ˜ October 31  November 1, 2011 * Barcelona, Spain ˜ 
November 28  29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA — October 31  November 1, 2011
*  Barcelona, Spain — November 28  29, 2011

Re: [rt-users] Setting Custom Field during Ticket creation in Perl API (4.0.2)

2011-10-18 Thread Srikumar Nair
Thanks Ruslan. Where can I find the file t/web/search_cf_quotes.t? Is it
part of the RT distribution?



On 10/18/11 9:33 AM, Ruslan Zakirov r...@bestpractical.com wrote:

Hi,

Example from t/web/search_cf_quotes.t

17 RT::Test-create_tickets(
18 { Queue   = 'General' },
19 { Subject = 'ticket foo', 'CustomField-' . $cf-id =
'2011-09-15' },
20 { Subject = 'ticket bar', 'CustomField-' . $cf-id =
'2011-10-15' },
21 { Subject = 'ticket baz' },
22 );

create_tickets sends most args into RT::Ticket::Create without changes.

For sure SetIncludeContentForValue is not what you want.

On Tue, Oct 18, 2011 at 8:20 PM, Srikumar Nair srikum...@fb.com wrote:
 retrying.. I am pretty sure there is someone in the community who can
tell
 me what I am doing wrong ..


 I am trying to set a Custom Field Value during the creation of a ticket
with
 the following piece of code. But the value (SN-1234) is not getting
added
 to custom field
 (BTW, I already pre created the Custom Field for the Ticket object and
made
 it Global).
 What am I doing wrong? Is SetIncludeContentForValue the correct API
call?
 =
 my $cf = RT::CustomField-new($RT::SystemUser);
 $cf-Load('Store Number');
 unless ($cf-id) {
   $RT::Logger-error( Couldn't load custom field  . Store Number);
 }
 $cf-SetIncludeContentForValue (SN-1234);
 @retValues = $ticket-Create( Queue = 'My Store Queue', Subject =
'Test
 Ticket for Store 1234 ', CustomField = $cf);
 =
 Thanks

 ~



 ~



 ~



 ~
  RT Training Sessions
 (http://bestpractical.com/services/training.html) * Washington DC, USA —
 October 31  November 1, 2011 * Barcelona, Spain — November 28  29,
2011
 
 RT Training Sessions (http://bestpractical.com/services/training.html)
 *  Washington DC, USA ‹ October 31  November 1, 2011
 *  Barcelona, Spain ‹ November 28  29, 2011




-- 
Best regards, Ruslan.


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


[rt-users] Creating ticket with Attachment using Perl APIs (4.0.2)

2011-10-17 Thread Srikumar Nair
I am trying to create a ticket with attachment thru the Perl APIs.

I don't see a method in the RT::Ticket API for adding attachment during ticket 
creation.

When looking at the RT::Attachment API it says This module should never be 
instantiated directly by client code. it's an internal module which should only 
be instantiated through exported APIs.

So wondering how I can create a ticket with attachment.


If any one have a few of lines of sample code that will be appreciated.

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

Re: [rt-users] Creating ticket with Attachment using Perl APIs (4.0.2)

2011-10-17 Thread Srikumar Nair
Thanks Thomas..

Following lines of code did what I was looking for..

my $mimeObj = MIME::Entity-build(Description = My Attachment,
 Path=
/path/to/file/file.pdf,
 Type= application/pdf,
 Encoding= base64);

$mimeObj-attach(Path= /path/to/file2/file2.pdf,
 Type= application/pdf,
 Encoding= base64);

My @retValues = $ticket-Create( Queue = 'My Queue', Subject = 'Create
Ticket with PDF ', MIMEObj = $mimeObj);





On 10/17/11 11:03 AM, Thomas Sibley t...@bestpractical.com wrote:

On 10/17/2011 01:47 PM, Srikumar Nair wrote:
 I am trying to create a ticket with attachment thru the Perl APIs.

 I don't see a method in the RT::Ticket API for adding attachment during
 ticket creation.

 When looking at the RT::Attachment API it says This module should never
 be instantiated directly by client code. it's an internal module which
 should only be instantiated through exported APIs.

 So wondering how I can create a ticket with attachment.

You need to construct a MIME entity and pass it in as the MIMEObj
argument.  There is a not terribly simple example of this in
CreateTicket in RT::Interface::Web.

Thomas

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] REST queries/search for queue objects in 4.0.2

2011-10-14 Thread Srikumar Nair
Thanks.. While searching for APIs I noticed some emails talking about the
Ticket_Overlay.pm file in the $RT_HOME/lib/RT folder.
But I can't seem to find any file with the name *Overlay* in this folder
(I am using 4.0.2).
Where are these *Overlay* files in 4.0.2?



On 10/14/11 5:52 AM, Kevin Falcone falc...@bestpractical.com wrote:

On Thu, Oct 13, 2011 at 11:26:20PM +, Srikumar Nair wrote:
 I see that the REST APIs has a search method to do search for tickets
based on some conditions (Request:
/REST/1.0/search/ticket?query=queryorderby=sort-orderformat=format
).
 
 Is there an equivalent one for the Queue object? When I tried it I got
errorŠ
 
 Following is query string:
 
 /REST/1.0/search/queue?query= Name = 'My Special Queue'
 
 And the response is == (RT/4.0.2 500 Server Error. Unsupported object
type)
 
 Is there a way to query/search non ticket objects using conditions?

RT's REST API is intended mostly for working with tickets (the query
is actually TicketSQL as available in the normal Query Builder UI).

If you need to work with and modify other RT objects, you'll want to
use RT's perl API.

-kevin

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


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] REST queries/search for queue objects in 4.0.2

2011-10-14 Thread Srikumar Nair
Great.. Thanks Kevin.

On 10/14/11 10:29 AM, Kevin Falcone falc...@bestpractical.com wrote:

On Fri, Oct 14, 2011 at 05:25:59PM +, Srikumar Nair wrote:
 Thanks.. While searching for APIs I noticed some emails talking about
the
 Ticket_Overlay.pm file in the $RT_HOME/lib/RT folder.
 But I can't seem to find any file with the name *Overlay* in this folder
 (I am using 4.0.2).
 Where are these *Overlay* files in 4.0.2?

4.0 finally merged the Queue.pm and Queue_Overlay.pm files.
You can now safely read the Queue.pm or Ticket.pm file with perldoc

-kevin


 On 10/14/11 5:52 AM, Kevin Falcone falc...@bestpractical.com wrote:
 
 On Thu, Oct 13, 2011 at 11:26:20PM +, Srikumar Nair wrote:
  I see that the REST APIs has a search method to do search for tickets
 based on some conditions (Request:
 
/REST/1.0/search/ticket?query=queryorderby=sort-orderformat=form
at
 ).
  
  Is there an equivalent one for the Queue object? When I tried it I
got
 errorŠ
  
  Following is query string:
  
  /REST/1.0/search/queue?query= Name = 'My Special Queue'
  
  And the response is == (RT/4.0.2 500 Server Error. Unsupported
object
 type)
  
  Is there a way to query/search non ticket objects using conditions?
 
 RT's REST API is intended mostly for working with tickets (the query
 is actually TicketSQL as available in the normal Query Builder UI).
 
 If you need to work with and modify other RT objects, you'll want to
 use RT's perl API.

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA ˜ October 18  19, 2011
*  Washington DC, USA ˜ October 31  November 1, 2011
*  Barcelona, Spain ˜ November 28  29, 2011


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011

Re: [rt-users] REST queries/search for queue objects in 4.0.2

2011-10-14 Thread Srikumar Nair
I am trying to use the following two lines of code to get started with the
PERL API..

my $ticket = RT::Ticket-new($RT::SystemUser);
$ticket-Create( Queue = 'General', Subject = 'Test Ticket');


But it results in the error..

Can't call method CaseSensitive on an undefined value at
/opt/rt4/lib/RT/Record.pm line 363.

Has anyone seen this issue?

Thanks


On 10/14/11 10:29 AM, Kevin Falcone falc...@bestpractical.com wrote:

On Fri, Oct 14, 2011 at 05:25:59PM +, Srikumar Nair wrote:
 Thanks.. While searching for APIs I noticed some emails talking about
the
 Ticket_Overlay.pm file in the $RT_HOME/lib/RT folder.
 But I can't seem to find any file with the name *Overlay* in this folder
 (I am using 4.0.2).
 Where are these *Overlay* files in 4.0.2?

4.0 finally merged the Queue.pm and Queue_Overlay.pm files.
You can now safely read the Queue.pm or Ticket.pm file with perldoc

-kevin


 On 10/14/11 5:52 AM, Kevin Falcone falc...@bestpractical.com wrote:
 
 On Thu, Oct 13, 2011 at 11:26:20PM +, Srikumar Nair wrote:
  I see that the REST APIs has a search method to do search for tickets
 based on some conditions (Request:
 
/REST/1.0/search/ticket?query=queryorderby=sort-orderformat=form
at
 ).
  
  Is there an equivalent one for the Queue object? When I tried it I
got
 errorŠ
  
  Following is query string:
  
  /REST/1.0/search/queue?query= Name = 'My Special Queue'
  
  And the response is == (RT/4.0.2 500 Server Error. Unsupported
object
 type)
  
  Is there a way to query/search non ticket objects using conditions?
 
 RT's REST API is intended mostly for working with tickets (the query
 is actually TicketSQL as available in the normal Query Builder UI).
 
 If you need to work with and modify other RT objects, you'll want to
 use RT's perl API.

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA ˜ October 18  19, 2011
*  Washington DC, USA ˜ October 31  November 1, 2011
*  Barcelona, Spain ˜ November 28  29, 2011


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011

[rt-users] Creating attachments during ticket creation with REST (4.0.2)

2011-10-14 Thread Srikumar Nair
I am trying to add an attachment as part of the ticket creation with REST (in 
4.0.2)
Following is my input:

Requestor: johnt
Subject: 'test ticket'
Queue: 'General'
Attachment: /var/log/test.pdf

Ticket gets created but no attachment  and I get the error

RT/4.0.2 409 Syntax Error
# Ticket 6 created.
# attachment: Unknown field.

What is the input to create ticket with attachments? Does anyone know?

Thanks







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

Re: [rt-users] REST queries/search for queue objects in 4.0.2

2011-10-14 Thread Srikumar Nair
That is helpful.. That took care of the issue.

Thanks


On 10/14/11 3:16 PM, Ruslan Zakirov r...@bestpractical.com wrote:

Hi,

You probably forgot to load config and init RT. Usually in the
beginning of a scrip you have:

use 5.008003;
use strict;
use warnings;

use lib qw(/opt/rt4/local/lib /opt/rt4/lib);

use RT;
RT::LoadConfig();
RT::Init();

... code goes here ...

On Fri, Oct 14, 2011 at 10:40 PM, Srikumar Nair srikum...@fb.com wrote:
 I am trying to use the following two lines of code to get started with
the
 PERL API..

 my $ticket = RT::Ticket-new($RT::SystemUser);
 $ticket-Create( Queue = 'General', Subject = 'Test Ticket');


 But it results in the error..

 Can't call method CaseSensitive on an undefined value at
 /opt/rt4/lib/RT/Record.pm line 363.

 Has anyone seen this issue?

 Thanks


 On 10/14/11 10:29 AM, Kevin Falcone falc...@bestpractical.com wrote:

On Fri, Oct 14, 2011 at 05:25:59PM +, Srikumar Nair wrote:
 Thanks.. While searching for APIs I noticed some emails talking about
the
 Ticket_Overlay.pm file in the $RT_HOME/lib/RT folder.
 But I can't seem to find any file with the name *Overlay* in this
folder
 (I am using 4.0.2).
 Where are these *Overlay* files in 4.0.2?

4.0 finally merged the Queue.pm and Queue_Overlay.pm files.
You can now safely read the Queue.pm or Ticket.pm file with perldoc

-kevin


 On 10/14/11 5:52 AM, Kevin Falcone falc...@bestpractical.com
wrote:

 On Thu, Oct 13, 2011 at 11:26:20PM +, Srikumar Nair wrote:
  I see that the REST APIs has a search method to do search for
tickets
 based on some conditions (Request:

/REST/1.0/search/ticket?query=queryorderby=sort-orderformat=fo
rm
at
 ).
 
  Is there an equivalent one for the Queue object? When I tried it I
got
 errorŠ
 
  Following is query string:
 
  /REST/1.0/search/queue?query= Name = 'My Special Queue'
 
  And the response is == (RT/4.0.2 500 Server Error. Unsupported
object
 type)
 
  Is there a way to query/search non ticket objects using conditions?
 
 RT's REST API is intended mostly for working with tickets (the query
 is actually TicketSQL as available in the normal Query Builder UI).
 
 If you need to work with and modify other RT objects, you'll want to
 use RT's perl API.

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA ˜ October 18  19, 2011
*  Washington DC, USA ˜ October 31  November 1, 2011
*  Barcelona, Spain ˜ November 28  29, 2011

 
 RT Training Sessions (http://bestpractical.com/services/training.html)
 *  San Francisco, CA, USA  October 18  19, 2011
 *  Washington DC, USA  October 31  November 1, 2011
 *  Barcelona, Spain  November 28  29, 2011



-- 
Best regards, Ruslan.


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011

[rt-users] REST queries/search for queue objects in 4.0.2

2011-10-13 Thread Srikumar Nair
I see that the REST APIs has a search method to do search for tickets based on 
some conditions (Request: 
/REST/1.0/search/ticket?query=queryorderby=sort-orderformat=format).

Is there an equivalent one for the Queue object? When I tried it I got error…

Following is query string:

/REST/1.0/search/queue?query= Name = 'My Special Queue'

And the response is == (RT/4.0.2 500 Server Error. Unsupported object type)

Is there a way to query/search non ticket objects using conditions?

Thanks


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

Re: [rt-users] AuthToken field/attribute in Users Object (RT 4.0.2)

2011-10-11 Thread Srikumar Nair
Thanks Kevin.

On 10/11/11 8:54 AM, Kevin Falcone falc...@bestpractical.com wrote:

On Mon, Oct 10, 2011 at 07:26:23PM +, Srikumar Nair wrote:
I am referring to the AuthToken column in the Users table in the RT
installation (4.0.2)
Does any one know what is this field used for?
I have seen this getting set when I create some users and it does
not get set when I create
some other users.
When does this get set and what is it used for?

If you visit Preferences - About Me, you'll see the Secret
Authentication Token box with an explanation of where it's used.

It is lazily generated the first time it's needed.

-kevin

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


RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


[rt-users] AuthToken field/attribute in Users Object (RT 4.0.2)

2011-10-10 Thread Srikumar Nair
I am referring to the AuthToken column in the Users table in the RT 
installation (4.0.2)

Does any one know what is this field used for?

I have seen this getting set when I create some users and it does not get set 
when I create some other users.
When does this get set and what is it used for?

Thanks much.


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