Rt-client ruby gem - getting started

I’m playing around with the rt-client ruby gem, and running into some
difficulty. After adding to my rails app and creating a .rtclientrc
file in my project directory, I can successfully access the objects and
methods in the console using RT_Client.new.

rt = RT_Client.new

rt.user
=> peter

returns my user name, so it’s successfully accessing the configuration
options in my config file.

rt.status
=> “RT/3.8.7 200 Ok\n\n# Invalid object specification:
‘index.html’\n\nid: index.html\n\n”

it appears that credentials aren’t being passed?

rt.cookie
returns the contents of the cookie file, which is being created and can
be found in the correct specified directory as per the .rtclientrc file.

rt.server
=> https://myserverdomain.com/rt/

and going directly to

https://myserverdomain.com/rt/REST.1.0/ticket/1/show?user=username&pass=password

Using the same username and password successfully displays the first
ticket, so my credentials are correct

I’m on Ruby 1.9.3-p286

Any thoughts on what I might be missing? Using the latest gem, 0.4.1

What is it you are trying to do that isn’t working? Looking at the
methods available, it seems they mirror the RT CLI methods:

http://rt-client.rubyforge.org/

So if you want to show a ticket like your example, it seems you would
call rt.show and pass the ticket id.On 5/4/13 1:33 PM, Peter Roosakos wrote:

I’m playing around with the rt-client ruby gem, and running into some
difficulty. After adding to my rails app and creating a .rtclientrc
file in my project directory, I can successfully access the objects and
methods in the console using RT_Client.new.

rt = RT_Client.new

rt.user
=> peter

returns my user name, so it’s successfully accessing the configuration
options in my config file.

rt.status
=> “RT/3.8.7 200 Ok\n\n# Invalid object specification:
‘index.html’\n\nid: index.html\n\n”

it appears that credentials aren’t being passed?

rt.cookie
returns the contents of the cookie file, which is being created and can
be found in the correct specified directory as per the .rtclientrc file.

rt.server
=> https://myserverdomain.com/rt/

and going directly to

https://myserverdomain.com/rt/REST.1.0/ticket/1/show?user=username&pass=password

Using the same username and password successfully displays the first
ticket, so my credentials are correct

I’m on Ruby 1.9.3-p286

Any thoughts on what I might be missing? Using the latest gem, 0.4.1

Peter,

I had slightly more success with an older version of Ruby and the
rt/client gem. Here’s the info from RVM:

ruby-1.8.7-p371 [ i686 ]

I was also encountering problems with manipulating objects despite this.
If you find a solution, there are others interested.
In the interest of expediency and time constraints, I had to switch to
Perl to get our initial integration between ticketing (RT) and bug
tracking (Rally) back on schedule.

Regards,

Eli BoazOn 5/4/13 12:33 PM, “Peter Roosakos” proosakos@yahoo.com wrote:

I’m playing around with the rt-client ruby gem, and running into some
difficulty. After adding to my rails app and creating a .rtclientrc
file in my project directory, I can successfully access the objects and
methods in the console using RT_Client.new.

rt = RT_Client.new

rt.user
=> peter

returns my user name, so it’s successfully accessing the configuration
options in my config file.

rt.status
=> “RT/3.8.7 200 Ok\n\n# Invalid object specification:
‘index.html’\n\nid: index.html\n\n”

it appears that credentials aren’t being passed?

rt.cookie
returns the contents of the cookie file, which is being created and can
be found in the correct specified directory as per the .rtclientrc file.

rt.server
=> https://myserverdomain.com/rt/

and going directly to

https://myserverdomain.com/rt/REST.1.0/ticket/1/show?user=username&pass=pa
ssword

Using the same username and password successfully displays the first
ticket, so my credentials are correct

I’m on Ruby 1.9.3-p286

Any thoughts on what I might be missing? Using the latest gem, 0.4.1

This is an old thread, but ranks highly in searches for the ruby gem.

The gem is now on github, at https://github.com/uidzip/rt-client

If there are any issues encountered with the gem, please notify me there, or clone it and make a pull request if you like.