Keep an eye on certain customers

Jens Bothe26. Sep 2010 | AdministrationBest PracticesConsulting

This post is about a customer’s request:

Hi, maybe you can help me please. :)
I have a common queue for all calls, I would like to create an ACL where a specific group can see only tickets for a single customer on StatusView. […]

Well, no, that’s not possible via ACL as you can’t hide tickets from an agent with ACL. But there are two (hopefully equal) options for you – use a saved search profile or add your own plugin to the Dashboard.

Use a customized search

The easy solution – each agent has the option to save a search profile as a template for later re-use:

Save the search profile

Save the search profile

Use the saved search profile

Use the saved search profile

Now we want a quick access to this search profile from everywhere inside the OTRS and thus enable access to search-profiles from the navigation bar via the SysConfig

Ticket -> Frontend::Agent::NavBarModule
  Frontend::NavBarModule###1-Ticket::TicketSearchProfile:
  Agent interface module to access search profiles via nav bar.
Search profiles in the navigation bar

Search profiles in the navigation bar

Use a customized Dashboard plugin

Now the more challenging but nicer option – add your own Dashlet to the Dashboard.

The known Dashlets “Reminder Tickets”, “Escalated Tickets”, etc. are in fact ticket searches performed for each Agent calling the Dashboard. The searches are defined initially in an XML file and can be altered via the SysConfig interface later on.

Step 1 – create your own XML file

OTRS delivers its default configuration as XML files which are placed to

Kernel/Config/Files

The Dashboard description is part of the Ticket area and can be found in Ticket.xml (just search for Dashboard in the file).

We create our own configuration file, name it MyConfig.xml and add the necessary XML container to the file:

<?xml version="1.0" encoding="utf-8"?>
 <otrs_config version="1.0" init="Application">
</otrs_config>

Step 2 – copy & paste a Dashlet

From the mentioned Ticket.xml we get the description of a Dashlet e.g. “Open Tickets” and paste it to our file which should then look like this:

<?xml version="1.0" encoding="utf-8"?>
 <otrs_config version="1.0" init="Application">
  <ConfigItem Name="DashboardBackend###0130-TicketOpen" Required="0" Valid="1">
  <Description Lang="en">Parameters  for the dashboard backend. ...</Description>
  <Description Lang="de">Parameter  für das Dashboard Backend. ... </Description>
  <Group>Ticket</Group>
  <SubGroup>Frontend::Agent::Dashboard</SubGroup>
  <Setting>
   <Hash>
    <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
    <Item Key="Title">Open Tickets / Need to be answered</Item>
    <Item Key="Description">Tickets which need to be answered!</Item>
    <Item Key="Attributes">StateType=open;</Item>
    <Item Key="Filter">All</Item>
    <Item Key="Time">Age</Item>
    <Item Key="Limit">10</Item>
    <Item Key="Permission">rw</Item>
    <Item Key="Block">ContentLarge</Item>
    <Item Key="Group"></Item>
    <Item Key="Default">1</Item>
    <Item Key="CacheTTLLocal">0.5</Item>
   </Hash>
  </Setting>
 </ConfigItem>
</otrs_config>

Step 3 – modify the configuration to your needs

The interesting parts are

  • Attributes – the parameters to AgentTicketSearch()
  • Filter – which tickets should be considered
  • Time – which time should be shown in the Dashlet
  • Limit – how many tickets should be shown per screen
  • Permissions – which permissions does the agent need on a ticket so it gets shown
  • Group – which group (and through Roles – which Agent) should see this Dashlet
  • Default – is the Dashlet activated by default or optional for the Agent
  • CacheTTLLocal – how often should the content be refreshed (in minutes)

As I stated earlier, the Dashlets are just a ticket search. If you have a look at the Attributes of the Dashlet “Reminder Tickets” – <Item Key=”Attributes”>TicketPendingTimeOlderMinutes=1;StateType=pending reminder;SortBy=PendingTime;OrderBy=Down; </Item> – you get an impression what could be possible.

The AgentTicketSearch() function is described in the Developer manual [AgentTSearch].

The Filter is one of the following values

  • Locked
  • Watcher
  • Responsible
  • MyQueues
  • All

The Time can be one out of these settings

  • Age
  • UntilTime
    (for pending states)
  • General escalation info of nearest escalation type
    • EscalationTimeWorkingTime
      (seconds of working/service time till escalation, e. g. “1800”
    • EscalationTime
      (seconds total till escalation of nearest escalation time type – response, update or solution time, e. g. “3600”)
  • Detail escalation info about first response, update and solution time
    • FirstResponseTimeWorkingTime
      (seconds of working/service time till escalation, e. g. “1800”)
    • FirstResponseTime
      (seconds total till escalation, e. g. “3600”)
    • UpdateTimeWorkingTime
      (seconds of working/service time till escalation, e. g. “1800”)
    • UpdateTime
      (seconds total till escalation, e. g. “3600”)
    • SolutionTimeWorkingTime
      (seconds of working/service time till escalation, e. g. “1800”)
    • SolutionTime
      (seconds total till escalation, e. g. “3600”)

For the initial request we just need the CustomerID, the open/new state and a permission group. Please also change the name and position of the Dashlet!

So here’s the final myConfig.xml

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
 <ConfigItem Name="DashboardBackend###0600-TicketCustomerABC" Required="0" Valid="1">
  <Description Lang="en">Parameters  for the dashboard backend. ...</Description>
  <Description Lang="de">Parameter  für das Dashboard Backend. ...</Description>
  <Group>Ticket</Group>
  <SubGroup>Frontend::Agent::Dashboard</SubGroup>
  <Setting>
   <Hash>
    <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
    <Item Key="Title">Tickets for Customer ABC</Item>
    <Item Key="Description">All tickets for customer ABC</Item>
    <Item Key="Attributes">CustomerID=foobar.inc;StateType=open;StateType=new;</Item>
    <Item Key="Filter">All</Item>
    <Item Key="Time">Age</Item>
    <Item Key="Limit">10</Item>
    <Item Key="Permission">rw</Item>
    <Item Key="Block">ContentLarge</Item>
    <Item Key="Group">G_CustomerABC</Item>
    <Item Key="Default">1</Item>
    <Item Key="CacheTTLLocal">5</Item>
   </Hash>
  </Setting>
 </ConfigItem>
</otrs_config>

Step 4 – apply the new setting to the system

Simply run
perl bin/otrs.RebuildConfig.pl
and you have the new Dashlet definition available in your SysConfig

Ticket -> Frontend::Agent::Dashboard
DashboardBackend###0600-TicketCustomerABC
Configuration via SysConfig

Configuration via SysConfig

and your Dashboard

Our example Dashlet

Our example Dashlet

Further Reading

[AgentTSearch] – http://dev.otrs.org/2.4/Kernel/System/Ticket.html#item_ticketsearch

#9
Jens at 31.05.2015, 10:47

rw if the user needs to have rw permission on the queue or ro if he just needs ro permission on the queue. I suggest to use rw

#8
David at 28.05.2015, 15:08

Thanks a lot. What are the possible values for the key "Permission"?

#7
Yuri at 24.04.2013, 11:32

Just interesting! I want to create dashlet with tickets which match to date entering in Dynamic Field "Due Date". How I can fill attributes for AgentTicketSearch() to do this?

#6
Sergani at 30.04.2011, 10:16

Fantastic!! Thanks a lot for the detailed info!!

#5
brilang at 25.10.2010, 16:29

I've posted a couple of samples of dashlets I've attempted to create using your instructions here: http://forums.otrs.org/viewtopic.php?f=53&t=6351 Neither one is working as I expected. Can you help?

#4
Daniel Ciaglia at 18.10.2010, 21:54

@brilang: Well, in the Attributes key you define the arguments for AgentTicketSearch(). In the developer manual (see link above) the TO field can be search by adding a "TO=%xyz@example.com%" string to the key. The % are necessary as database wildcards.

#3
brilang at 18.10.2010, 18:16

Very helpful. Now let's say I want to run my search on a certain to address like "support@example.com" for example. How would I configure the TO or CC in my customized dashboard Attributes field?

#2
Tweets that mention Keep an eye on certain customers - OTRS Community Blog -- Topsy.com at 26.09.2010, 19:09

[...] This post was mentioned on Twitter by Christopher T. Kuhn, Daniel Ciaglia. Daniel Ciaglia said: How to monitor specific customers in #OTRS Dashboard - http://bit.ly/9qt2wS [...]

#1
Nils Leideck at 26.09.2010, 15:20

Great! Thanks fo this comprehensive tutorial!

Your email address will not be published. Required fields are marked *