Get user who last responded to a ticket

Moderator: crythias

Post Reply
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Get user who last responded to a ticket

Post by cbravo »

Hello guys,

I'm trying to create a generic agent who will send emails depending on who was the last person who responded to a ticket. For instance, if the agent replied to a ticket and we are expecting a reply from the customer the generic agent will check if the ticket is 48 hours old and then send an email to remain the customer to please respond to the ticket.

Also, I want to do the same thing for the agents and if they don't reply to the customer an email will be send to their boss.

Is there any way I can know who was the last person responding to the ticket so I can create a filter for them?

Thank you in advance.

Greetings,

Carlos.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Get user who last responded to a ticket

Post by crythias »

the short answer is that the generic agent *gui* doesn't allow for that, though you might test a programmed one.

Another option would be to change the ticket state (new states "awaiting customer response" and "awaiting agent response") of type "open" upon appropriate communication path.
Read: If it's an agent reply, the next state should be "awaiting customer response", either by default or chosen.
If it's a customer followup, the next state should be "awaiting agent response".

Then, Generic Agent tests for this. (unfortunately, it doesn't check how old it has been in the current state.)

Escalation rules or pending would be other options, and pending was my preferred path to your situation, but I don't recall if there's a way to set pending on customer inbound.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
dylan650
Znuny newbie
Posts: 29
Joined: 18 May 2012, 19:48
Znuny Version: 3.1.2

Re: Get user who last responded to a ticket

Post by dylan650 »

I just started working on something like this. I couldn't exactly do this in the UI, so I decided to script it out. I've made a lot of progress but haven't finished it yet. I can share what I've done for now. You can use it to help you generate your own script.

#!/bin/bash

passwd=$1

query="select tn,title,change_time,preferences_value from otrs.user_preferences,otrs.ticket where ticket_state_id='11' and user_preferences.user_id=ticket.user_id and preferences_key='UserEmail';"

/usr/bin/mysql -B -u otrs_ro -p$passwd << eof
$query
eof

When I run it like this "./notify_agent.sh | sed 's/\t/,/g'", the results look like this...

ticketnumber,title_of_ticket,date/time_last_changed,agent_email (NOTE: in my system, ticket_state_id 11 means "waiting on agent" so this would assume that the customer has set the status to waiting on agent)

Using some further parsing, you could generate an e-mail if older than date/time_last_changed and send the email to the agent_email and place the ticketnumber and title in the email. You can do this using plain old CRON.

I did not look in to "waiting on customer" since our agent will ping them but I'm sure its something similar.
Post Reply