How to send a NSTicketMessageEntity?

Hi,

when using the plain classes in CRMScript for Message there are methods on it for sending the message, but what is the equivalent when using NSTicketAgent and NSTicketMessageEntity? How can I send a NSTicketMessageEntity as an e-mail?

//The "normal" way
Message m;
//(....)
m.send(to, cc, bb);


//The "agent" way
NSTicketAgent agent;
NSTicketMessageEntity message = agent.CreateDefaultTicketMessageEntity();
//(...)
//how to send..?

From what I can see there is no method on the NSTicketAgent or the NSTicketMessageEntity class to do the actual sending?

RE: How to send a NSTicketMessageEntity?

Yeah, I'd like to know this as well. I've been wondering about the same thing.

Av: Espen Steen 21. jan 2021

RE: How to send a NSTicketMessageEntity?

Maybe a documentation bug? The NetServer TicketAgent.SentTicketMessage method should work... compiled the CRMScript anyway... haven't tested though.


Av: Tony Yates 22. jan 2021

RE: How to send a NSTicketMessageEntity?

Think you are right.

That method doesn't exist at all in my local 9.1 R3 version, but it exists in SOD which seems to be 9.2 R4, although it is missing from intellisense.

Av: Frode Lillerud 22. jan 2021

RE: How to send a NSTicketMessageEntity?

The SendTicketMessage method doesn't show up in the CRMScript documentation, but it is possible to run in CRMScript. I did an attempt using it last week, but I had no luck sending anything - I couldn't wrap my head around some of the parameters it requires. Is it only meant for sending a message within a ticket and not a standalone email like you can with Message.send?

Av: Espen Steen 3. feb 2021

RE: How to send a NSTicketMessageEntity?

Hi Espen,

here is an example for the line that sends the actual e-mail.

String[] to;
to.pushBack("user@example.no");
String[] empty;

ticketAgent.SendTicketMessage(ticketId, to, empty, empty, "Testing", 0, "USER");

If you only want to send an email, and not have it saved as a message on the ticket, then you should just use the Email class.

 

Av: Frode Lillerud 3. feb 2021

RE: How to send a NSTicketMessageEntity?

Okey, I'll try that. Thanks!

Av: Espen Steen 3. feb 2021