Automating ticket updates via RT::Client::REST

I’ve done some searching and perhaps my Google-fu is lacking, but I was wondering if there were any examples of updating tickets via RT::Client::REST::Ticket, aside from the information available on CPAN.

What I’m specifically looking to do is be able to update a custom field and (optionally) add a comment to the case when a defect is updated in a separate system.

I’ve been able to add/change/delete attributes, but I where am running into problems is adding a comment without sending the email to the admin_cc list, unless I actually delete the admin_cc list before as I’m doing in the test/proof of concept snippet I’ve copied below.

my @ids = qw/6119/;

my $comment = “This is a test from Perl”;
for my $id (@ids) {

my $ticket = RT::Client::REST::Ticket->new(rt => $rt, id => $id);
my @admin_cc = $ticket->admin_cc();

if((scalar @admin_cc) > 0) {
$ticket->delete_admin_cc(@admin_cc);
}

$ticket->comment(message=>$comment);
try {
$ticket->store;
} catch Exception::Class::Base with {
die “Unable to store ticket update”, shift->message;
};
}

Thanks in advance,

Eli Boaz

I’ve done some searching and perhaps my Google-fu is lacking, but I was
wondering if there were any examples of updating tickets via
RT::Client::REST::Ticket, aside from the information available on CPAN.

What I’m specifically looking to do is be able to update a custom field
and (optionally) add a comment to the case when a defect is updated in a
separate system.

Read a little bit farther

Best regards, Ruslan.

Hi Ruslan,

Thanks, I had actually gotten this part working and my apologies as my email was unclear on this point, but where I had encountered problems was adding a comment without sending an email to the admin_cc list unless I actually delete the admin_cc list before posting the comment. This is something that is possible to do by unchecking the individuals in the admin_cc list of the comment page, if one were to manually login and add a comment to the case.

Can this be done via the REST api? If not then we’ll go with an additional custom field, which is something we’re trying to keep down to a minimum.

Thanks again,

-EliFrom: Ruslan Zakirov <ruz@bestpractical.commailto:ruz@bestpractical.com>
Date: Friday, April 26, 2013 2:04 AM
To: Eli Boaz <eboaz@icontrol.commailto:eboaz@icontrol.com>
Cc: RT User List <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] Automating ticket updates via RT::Client::REST

I’ve done some searching and perhaps my Google-fu is lacking, but I was wondering if there were any examples of updating tickets via RT::Client::REST::Ticket, aside from the information available on CPAN.

What I’m specifically looking to do is be able to update a custom field and (optionally) add a comment to the case when a defect is updated in a separate system.

Read a little bit farther

Best regards, Ruslan.

Hi Ruslan,

Thanks, I had actually gotten this part working and my apologies as my
email was unclear on this point, but where I had encountered problems was
adding a comment without sending an email to the admin_cc list unless I
actually delete the admin_cc list before posting the comment. This is
something that is possible to do by unchecking the individuals in the
admin_cc list of the comment page, if one were to manually login and add a
comment to the case.

Can this be done via the REST api? If not then we’ll go with an
additional custom field, which is something we’re trying to keep down to a
minimum.

I don’t think it’s possible to squelch recipients while replying via REST.

Thanks again,

-Eli

From: Ruslan Zakirov ruz@bestpractical.com
Date: Friday, April 26, 2013 2:04 AM
To: Eli Boaz eboaz@icontrol.com
Cc: RT User List rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Automating ticket updates via RT::Client::REST

I’ve done some searching and perhaps my Google-fu is lacking, but I was
wondering if there were any examples of updating tickets via
RT::Client::REST::Ticket, aside from the information available on CPAN.

What I’m specifically looking to do is be able to update a custom field
and (optionally) add a comment to the case when a defect is updated in a
separate system.

Read a little bit farther

RT::Client::REST::Ticket - this object represents a ticket. - metacpan.org


Best regards, Ruslan.

Best regards, Ruslan.

Rulan,

Thanks again. I’ll look at using a custom field for now.

Regards,

-EliFrom: Ruslan Zakirov <ruz@bestpractical.commailto:ruz@bestpractical.com>
Date: Friday, April 26, 2013 9:18 AM
To: Eli Boaz <eboaz@icontrol.commailto:eboaz@icontrol.com>
Cc: RT User List <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] Automating ticket updates via RT::Client::REST

Hi Ruslan,

Thanks, I had actually gotten this part working and my apologies as my email was unclear on this point, but where I had encountered problems was adding a comment without sending an email to the admin_cc list unless I actually delete the admin_cc list before posting the comment. This is something that is possible to do by unchecking the individuals in the admin_cc list of the comment page, if one were to manually login and add a comment to the case.

Can this be done via the REST api? If not then we’ll go with an additional custom field, which is something we’re trying to keep down to a minimum.

I don’t think it’s possible to squelch recipients while replying via REST.

Thanks again,

-Eli

From: Ruslan Zakirov <ruz@bestpractical.commailto:ruz@bestpractical.com>
Date: Friday, April 26, 2013 2:04 AM
To: Eli Boaz <eboaz@icontrol.commailto:eboaz@icontrol.com>
Cc: RT User List <rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com>
Subject: Re: [rt-users] Automating ticket updates via RT::Client::REST

I’ve done some searching and perhaps my Google-fu is lacking, but I was wondering if there were any examples of updating tickets via RT::Client::REST::Ticket, aside from the information available on CPAN.

What I’m specifically looking to do is be able to update a custom field and (optionally) add a comment to the case when a defect is updated in a separate system.

Read a little bit farther

Best regards, Ruslan.

Best regards, Ruslan.