Create transaction record

Hello List

I have created a custom scrip the will respond to an email via a web service call. I would like to create a transaction with the return message.

Can someone give me a little code snippet or some direction on how to create the transaction? With our creating or updating a custom field.

I have read about the _RecoredTransaction but I think this may be the wrong route and I have not found any example code to help me out.

Thanks in advance for the help.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 * 262-783-6261 Ext. 2296
bbaker@copesan.commailto:bbaker@copesan.com
www.copesan.comhttp://www.copesan.com/
“Servicing North America with Local Care”

Hello List

I have created a custom scrip the will respond to an email via a web service
call. I would like to create a transaction with the return message.

What do you want the txn to do? Set a custom field, change an owner, etc?

Can someone give me a little code snippet or some direction on how to create
the transaction? With our creating or updating a custom field.

Generally you would probably want to have two scrips:

  1. On Condition C, reply to (or notify) requestor using template T

  2. On Condition C, perform your specific txn using a blank template.

But it is hard to give advice without a little more clarity in your question.

Thanks,

-m

Matt
Thanks for the reply.

All I want to do is add an entry in the ticket history that contains the return information from the call to the web service. I have the information logged to the log file, but I also want an entry record in the history of the ticket. So no action something very simple.

I know when a custom fields are changed or updated this information shows up in the history of the ticket. With the web service call a message is received but a custom field is not needed for the information, just would like an entry in the history of the ticket of the message from web service call.

I hear what you are saying. I don’t know off the top of my head how to
accomplish it.

So you have:

Email → RT → Scrip gets triggered → Web service call is made

-m

Matt
Thanks for the reply.

All I want to do is add an entry in the ticket history that contains the return information from the call to the web service. I have the information logged to the log file, but I also want an entry record in the history of the ticket. So no action something very simple.

I know when a custom fields are changed or updated this information shows up in the history of the ticket. With the web service call a message is received but a custom field is not needed for the information, just would like an entry in the history of the ticket of the message from web service call.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 • 262-783-6261 Ext. 2296
bbaker@copesan.com

"Servicing North America with Local Care"From: Matt Zagrabelny [mailto:mzagrabe@d.umn.edu]
Sent: Tuesday, October 11, 2016 1:47 PM
To: Bryon Baker bbaker@copesan.com
Cc: rt-users rt-users@lists.bestpractical.com
Subject: Re: [rt-users] create transaction record

Hello List

I have created a custom scrip the will respond to an email via a web
service call. I would like to create a transaction with the return message.

What do you want the txn to do? Set a custom field, change an owner, etc?

Can someone give me a little code snippet or some direction on how to
create the transaction? With our creating or updating a custom field.

Generally you would probably want to have two scrips:

  1. On Condition C, reply to (or notify) requestor using template T

  2. On Condition C, perform your specific txn using a blank template.

But it is hard to give advice without a little more clarity in your question.

Thanks,

-m

Yes that is what I am doing I hoping for some kind of call like “$RT::Logger->debug” for logging. But I have not found anything. The web service call is actually being executed from inside custom home built actions.

Thanks Matt come up with any ideas it would be greatly appreciated.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 • 262-783-6261 Ext. 2296
bbaker@copesan.com

“Servicing North America with Local Care”-----Original Message-----
From: Matt Zagrabelny [mailto:mzagrabe@d.umn.edu]
Sent: Tuesday, October 11, 2016 2:18 PM
To: Bryon Baker bbaker@copesan.com
Cc: rt-users rt-users@lists.bestpractical.com
Subject: Re: [rt-users] create transaction record

On Tue, Oct 11, 2016 at 1:54 PM, Bryon Baker bbaker@copesan.com wrote:

Matt
Thanks for the reply.

All I want to do is add an entry in the ticket history that contains the return information from the call to the web service. I have the information logged to the log file, but I also want an entry record in the history of the ticket. So no action something very simple.

I know when a custom fields are changed or updated this information shows up in the history of the ticket. With the web service call a message is received but a custom field is not needed for the information, just would like an entry in the history of the ticket of the message from web service call.

I hear what you are saying. I don’t know off the top of my head how to accomplish it.

So you have:

Email → RT → Scrip gets triggered → Web service call is made

-m

Yes that is what I am doing I hoping for some kind of call like “$RT::Logger->debug” for logging. But I have not found anything. The web service call is actually being executed from inside custom home built actions.

That would work. Or:

RT->Logger->debug(‘a line of debug’);

Regarding creating a txn for the ticket history: I may have at one
time created a txn and added it to the history, but I’m not seeing any
code examples in my extensions. I don’t quite remember how and don’t
have time to dig into the RT upstream code.

You could create a custom field called Web Services and set that CF to
whatever value your web services returns. That is pretty easy.

-m

Yes I thought of the custom field and that would be easy, but I have so many now. I just didn’t want to add another. But if I can’t find anything else that is what I will do eventually.

I’m sure there is a way to add a txn - apparently I’ve never done it
and would have to research (which I have no time for.)

-m

Yes I thought of the custom field and that would be easy, but I have so many now. I just didn’t want to add another. But if I can’t find anything else that is what I will do eventually.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 • 262-783-6261 Ext. 2296
bbaker@copesan.com

“Servicing North America with Local Care”-----Original Message-----
From: Matt Zagrabelny [mailto:mzagrabe@d.umn.edu]
Sent: Tuesday, October 11, 2016 3:09 PM
To: Bryon Baker bbaker@copesan.com
Cc: rt-users rt-users@lists.bestpractical.com
Subject: Re: [rt-users] create transaction record

On Tue, Oct 11, 2016 at 2:25 PM, Bryon Baker bbaker@copesan.com wrote:

Yes that is what I am doing I hoping for some kind of call like “$RT::Logger->debug” for logging. But I have not found anything. The web service call is actually being executed from inside custom home built actions.

That would work. Or:

RT->Logger->debug(‘a line of debug’);

Regarding creating a txn for the ticket history: I may have at one time created a txn and added it to the history, but I’m not seeing any code examples in my extensions. I don’t quite remember how and don’t have time to dig into the RT upstream code.

You could create a custom field called Web Services and set that CF to whatever value your web services returns. That is pretty easy.

-m

Don’t sweat it I will continue to research I was hoping that someone had some pointers

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 • 262-783-6261 Ext. 2296
bbaker@copesan.com

“Servicing North America with Local Care”-----Original Message-----
From: Matt Zagrabelny [mailto:mzagrabe@d.umn.edu]
Sent: Tuesday, October 11, 2016 4:12 PM
To: Bryon Baker bbaker@copesan.com
Cc: rt-users rt-users@lists.bestpractical.com
Subject: Re: [rt-users] create transaction record

On Tue, Oct 11, 2016 at 4:09 PM, Bryon Baker bbaker@copesan.com wrote:

Yes I thought of the custom field and that would be easy, but I have so many now. I just didn’t want to add another. But if I can’t find anything else that is what I will do eventually.

I’m sure there is a way to add a txn - apparently I’ve never done it and would have to research (which I have no time for.)

-m

Hello List

I have created a custom scrip the will respond to an email via a web
service call. I would like to create a transaction with the return
message.

Can someone give me a little code snippet or some direction on how to
create the transaction? With our creating or updating a custom field.

I have read about the _RecoredTransaction but I think this may be the
wrong route and I have not found any example code to help me out.

Have you read
RT::Transaction - RT 4.4.1 Documentation - Best Practical ?

Probably more useful:
https://docs.bestpractical.com/rt/4.4.1/RT/Ticket.html#Comment

The simplest way to call it, given a RT::Ticket object named ticket:

$ticket->Comment( Content => “I’m A Little Teapot” );

And now you have a new comment transaction.

Thanks Bill

I should have thought of that, I will pursue one of those options.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 * 262-783-6261 Ext. 2296
bbaker@copesan.com

“Servicing North America with Local Care”-----Original Message-----
From: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Bill Cole
Sent: Tuesday, October 11, 2016 11:16 PM
To: rt-users rt-users@lists.bestpractical.com
Subject: Re: [rt-users] create transaction record

On 10 Oct 2016, at 17:16, Bryon Baker wrote:

Hello List

I have created a custom scrip the will respond to an email via a web
service call. I would like to create a transaction with the return
message.

Can someone give me a little code snippet or some direction on how to
create the transaction? With our creating or updating a custom field.

I have read about the _RecoredTransaction but I think this may be the
wrong route and I have not found any example code to help me out.

Have you read
RT::Transaction - RT 4.4.1 Documentation - Best Practical ?

Probably more useful:
https://docs.bestpractical.com/rt/4.4.1/RT/Ticket.html#Comment

The simplest way to call it, given a RT::Ticket object named ticket:

$ticket->Comment( Content => “I’m A Little Teapot” );

And now you have a new comment transaction.
RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training

  • Boston - October 24-26
  • Los Angeles - Q1 2017