How to get old, new Status and Owner of Tickets

Hi,

 

there is no Before/After Trigger for Ticket. How to get old, new Status ( not BaseStatus)?

I want to send automatically Emails to Customer if Tickets positive closed.

 

And How to get old, new Owner?

I want to send automatically Emails to new User if Tickets assigned or changed to new User?

default is only by automatically Assignment of Catergory, Email will be sent to Owner. 

In our Support Routine, there is a Colleague who assigns daily Tickets to our Users.

Thanks!

RE: How to get old, new Status and Owner of Tickets

Hi,

Both your questions can be answered by looking at documentation for Ticket.save event. This will give you access to before/after values for fields on tickets.

By: Michel Krohn-Dale 7 Feb 2020

RE: How to get old, new Status and Owner of Tickets

Hi Michel

 

Thanks!

 

I have tried to post:

String oldStatus = "oldStaus: " + getParserVariable("ticket.old.ticket_status");
String newStatus = "newStatus: " + getParserVariable("ticket.new.ticket_status");
String oldOwner = "oldOwner: " + getParserVariable("ticket.old.owned_by");
String newOwner = "newOwner: " + getParserVariable("ticket.new.owned_by");

But it returns nothing. it only works with:

getParserVariable("ticket.old.status");

But I don't need BaseStatus.

By: Jianchun You 7 Feb 2020

RE: How to get old, new Status and Owner of Tickets

Hi,

You are almost there, you just need to use correct variable names, it is listed on documentation;

id
title
createdAt
lastChanged
readByOwner
readByCustomer
firstReadByUser
firstReadByOwner
activate
closedAt
deadline
timeToClose
realTimeToClose
timeToReply
m_realTimeToReply
createdBy
author
ownedBy
category
slevel
priority
status
ticketStatus
customer
alertLevel
alertTimeout
connectId
filterId
readStatus
hasAttachment
displayFilter
alertStop
repliedAt
filterAddress
dbiAgentId
dbiKey
dbiLastModified
dbiLastSyncronized

So if you use:

String oldStatus = "oldStaus: " + getParserVariable("ticket.old.ticketStatus");
String newStatus = "newStatus: " + getParserVariable("ticket.new.ticketStatus");
String oldOwner = "oldOwner: " + getParserVariable("ticket.old.ownedBy");
String newOwner = "newOwner: " + getParserVariable("ticket.new.ownedBy");
By: Michel Krohn-Dale 7 Feb 2020

RE: How to get old, new Status and Owner of Tickets

Hi Michel,

 

Thanks, this List will be helpful for me.

but:

String oldStatus = "oldStaus: " + getParserVariable("ticket.old.ticketStatus");
String newStatus = "newStatus: " + getParserVariable("ticket.new.ticketStatus");

 

still posts me the BaseStatus, same values like

getParserVariable("ticket.old.status"); getParserVariable("ticket.new.status");

I need renamed Ticket Status ID.

By: Jianchun You 7 Feb 2020

RE: How to get old, new Status and Owner of Tickets

Hi,

If I trace ticket.save event it is giving me correct user-defined status value as expected.

 

By: Michel Krohn-Dale 7 Feb 2020

RE: How to get old, new Status and Owner of Tickets

Hi Michel,

 

Sory, my Fault, i checked IDs not corerctly. Now it runs correctly.

By: Jianchun You 7 Feb 2020