Creating Custom Dashboard Dashlets

Moderator: crythias

Locked
brilang
Znuny newbie
Posts: 8
Joined: 18 Oct 2010, 21:03
Znuny Version: 2.4.7

Creating Custom Dashboard Dashlets

Post by brilang »

Over on the OTRS Community Blog, I found an article entitled "Keep an eye on certain customers"
This was very useful in starting me on the road to creating my own Dashboard Dashlets.

I'm having a devil of a time getting my Dashlets to show the data I want them to show...
Here's one example of my settings:

Code: Select all

        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">My Custom Ticket View</Item>
                <Item Key="Description">My Custom Ticket View of tickets which need to be answered!</Item>
                <Item Key="Attributes">QueueID=38;</Item>
                <Item Key="Filter">All</Item>
                <Item Key="Time">Age</Item>
                <Item Key="Limit">25</Item>
                <Item Key="Permission">rw</Item>
                <Item Key="Block">ContentLarge</Item>
                <Item Key="Group">GroupB</Item>
                <Item Key="Default">1</Item>
                <Item Key="CacheTTLLocal">0.5</Item>
            </Hash>
        </Setting>
The way I understand it, this should only show me tickets that are in QueueID 38. When I view this in the dashboard, it is showing me tickets from the entire system.
How can I filter my dashlet to only show the items in one queue?

Second example:

Code: Select all

        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">IT Department Tickets</Item>
                <Item Key="Description">IT Department Tickets which need to be answered!</Item>
                <Item Key="Attributes">Queue='[Inbox]';StateType=new;StateType=open;To=%support@example.com%;ContentSearch=AND;</Item>
                <Item Key="Filter">All</Item>
                <Item Key="Time">Age</Item>
                <Item Key="Limit">25</Item>
                <Item Key="Permission">rw</Item>
                <Item Key="Block">ContentLarge</Item>
                <Item Key="Group">users</Item>
                <Item Key="Default">1</Item>
                <Item Key="CacheTTLLocal">0.5</Item>
            </Hash>
        </Setting>
This dashlet is also showing all tickets in the system that are new or open, not matter what queue they're in. NOT what I expected.

Any help would be gratefully appreciated.
brilang
Znuny newbie
Posts: 8
Joined: 18 Oct 2010, 21:03
Znuny Version: 2.4.7

Re: Creating Custom Dashboard Dashlets

Post by brilang »

Doesn't anyone use the Dashboard?
daniel_c
Znuny newbie
Posts: 3
Joined: 20 Apr 2010, 06:53
Znuny Version: 2.4.7

Re: Creating Custom Dashboard Dashlets

Post by daniel_c »

Hi brilang,

there are some small problems in your posted examples but a bigger one inside the Dashboard...
<Item Key="Attributes">QueueID=38;</Item>
The attribute is called QueueIDs and has to be an array reference for the TicketSearch function (more on this array later on).
<Item Key="Attributes">Queue='[Inbox]';StateType=new;StateType=open;To=%support@example.com%;ContentSearch=AND;</Item>
Same here: the attribute has to be Queues and is an array too.

Here's the bigger problem - the arguments are not passed as array to the TicketSearch() function which creates some error messages in the OTRS logfile:
[Wed Oct 20 11:31:52 2010][Error][Kernel::System::Ticket::TicketSearch][3621] The given param 'QueueIDs' is invalid or an empty array reference!
[Wed Oct 20 11:19:36 2010][Error][Kernel::System::Ticket::TicketSearch][3621] The given param 'Queues' is invalid or an empty array reference!


See this bug report for more information:
http://bugs.otrs.org/show_bug.cgi?id=6012

As a workaround, please use at least 2 QueueIDs or 2 Queues as search attributes (even if they are the same):

Code: Select all

<Item Key="Attributes">QueueIDs=38;QueueIDs=38;</Item>
or

Code: Select all

<Item Key="Attributes">Queues=Inbox;Queues=Inbox;StateType=new;StateType=open;To=%support@example.com%;</Item>
I hope that helps and have ((fun))
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Creating Custom Dashboard Dashlets

Post by Mothra »

I am having trouble getting this to work with custom ticket states - where have I gone wrong? I have created a ticket state called "Awaiting Trace Response" (which is a closed type). This works fine in a search template, but the following code does not show the tickets in this state:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
 <otrs_config version="1.0" init="Application">
<ConfigItem Name="DashboardBackend###0310-TicketsAwaitingTraceResponse" Required="0" Valid="1">
        <Description Lang="en">Parameters for the dashboard backend. "Limit" are default shown entries. "Group" are used to restriced access to the plugin (e. g. Group: admin;group1;group2;). "Default" means if the plugin is enabled per default or if the user needs to enable it manually. "CacheTTLLocal" means the cache time in minutes for the plugin.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">Tickets Awaiting Trace Response</Item>
                <Item Key="Description">Tickets that are awaiting a trace response from a bank.</Item>
                <Item Key="Attributes">StateType=Awaiting Trace Response;</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>
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Creating Custom Dashboard Dashlets

Post by crythias »

You may not want to include an item that does not have a value (Group).
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
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Creating Custom Dashboard Dashlets

Post by Mothra »

crythias wrote:You may not want to include an item that does not have a value (Group).
I thought that too, but removing/changing it does not help. I eventually isolated the root cause to this line:

Code: Select all

<Item Key="Attributes">StateType=Awaiting Trace Response;</Item>
"StateType" refers to the backend states in the ticket_state_type table; whereas my new custom status is in the ticket_state table.

I checked the API documentation and found that the attribute I want is either States or StateIDs and, following the above workaround to the attribute array bug, either of the following will work:

Code: Select all

<Item Key="Attributes">States=Awaiting Trace Response;States=Awaiting Trace Response</Item>
or

Code: Select all

<Item Key="Attributes">StateIDs=11;StateIDs=11</Item>
(where 11 is the id of "Awaiting Trace Response" in the table ticket_state)

:-)
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
brilang
Znuny newbie
Posts: 8
Joined: 18 Oct 2010, 21:03
Znuny Version: 2.4.7

Re: Creating Custom Dashboard Dashlets

Post by brilang »

daniel_c wrote:Hi brilang,

there are some small problems in your posted examples but a bigger one inside the Dashboard...
<Item Key="Attributes">QueueID=38;</Item>
The attribute is called QueueIDs and has to be an array reference for the TicketSearch function (more on this array later on).
<Item Key="Attributes">Queue='[Inbox]';StateType=new;StateType=open;To=%support@example.com%;ContentSearch=AND;</Item>
Same here: the attribute has to be Queues and is an array too.

Here's the bigger problem - the arguments are not passed as array to the TicketSearch() function which creates some error messages in the OTRS logfile:
[Wed Oct 20 11:31:52 2010][Error][Kernel::System::Ticket::TicketSearch][3621] The given param 'QueueIDs' is invalid or an empty array reference!
[Wed Oct 20 11:19:36 2010][Error][Kernel::System::Ticket::TicketSearch][3621] The given param 'Queues' is invalid or an empty array reference!


See this bug report for more information:
http://bugs.otrs.org/show_bug.cgi?id=6012

As a workaround, please use at least 2 QueueIDs or 2 Queues as search attributes (even if they are the same):

Code: Select all

<Item Key="Attributes">QueueIDs=38;QueueIDs=38;</Item>
or

Code: Select all

<Item Key="Attributes">Queues=Inbox;Queues=Inbox;StateType=new;StateType=open;To=%support@example.com%;</Item>
I hope that helps and have ((fun))
Your answer was exactly what I needed! Thanks!
ftmova
Znuny newbie
Posts: 7
Joined: 30 Nov 2010, 15:39
Znuny Version: 2.4

Re: Creating Custom Dashboard Dashlets

Post by ftmova »

how can I change attributes that can have all the ticket management from an operator?
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Re: Creating Custom Dashboard Dashlets

Post by cbravo »

is there any way I could show the ticket owner on the dashlet? That would be awesome.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Creating Custom Dashboard Dashlets

Post by Mothra »

ftmova wrote:how can I change attributes that can have all the ticket management from an operator?
Set the attribute "OwnerIDs" (although bear in mind the bug above, which is fixed in OTRS 3.0.4).
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
Mothra
Znuny expert
Posts: 189
Joined: 26 Oct 2010, 15:04
Znuny Version: 3.2.11

Re: Creating Custom Dashboard Dashlets

Post by Mothra »

cbravo wrote:is there any way I could show the ticket owner on the dashlet? That would be awesome.
Had a quick look at this - you can show the login id of the ticket owner very easily, by creating a custom AgentDashboardTicketGeneric.dtl for your theme and then adding the following in the ContentLargeTicketGenericRowMeta block.

Code: Select all

   
            <td>
                <div title="$QData{"Owner"}">$QData{"Owner"}</div>
            </td>
Couldn't get it to display UserFirstname and UserLastname (as you get in AgentTicketOverviewSmall.dtl for example) - this would require a bit more work, probably modifying DashboardTicketGeneric.pm to look up and retrieve these values? Not sure - maybe someone else can answer this.
OTRS 3.2.11 on Centos 6.4 with MySQL 5.0. Agents and internal customers authenticate via Active Directory.
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Re: Creating Custom Dashboard Dashlets

Post by cbravo »

Mothra wrote:
cbravo wrote:is there any way I could show the ticket owner on the dashlet? That would be awesome.
Had a quick look at this - you can show the login id of the ticket owner very easily, by creating a custom AgentDashboardTicketGeneric.dtl for your theme and then adding the following in the ContentLargeTicketGenericRowMeta block.

Code: Select all

   
            <td>
                <div title="$QData{"Owner"}">$QData{"Owner"}</div>
            </td>
Couldn't get it to display UserFirstname and UserLastname (as you get in AgentTicketOverviewSmall.dtl for example) - this would require a bit more work, probably modifying DashboardTicketGeneric.pm to look up and retrieve these values? Not sure - maybe someone else can answer this.
Appreciate the help but I'm not sure what you mean by this. I couldn't even make it display the owner id and I added what you told me. Do I need to make a new ticket dashlet also? if it's not too much to ask would you mind guiding me how to do this?
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
cjseriy
Znuny newbie
Posts: 27
Joined: 05 Jan 2011, 22:03
Znuny Version: 3.04

Re: Creating Custom Dashboard Dashlets

Post by cjseriy »

I have added to dashboard two more visible states - Paid Orders (Queues=Billing) and Waiting for invoice (States=Invoice).
But I got a problem now, Paid Orders tickets have duplicates in New ticket section and Waiting for invoice have duplicates in Open tickets. But I dont want them to. How could I solve it?

Code: Select all

<ConfigItem Name="DashboardBackend###0600-Paid" Required="0" Valid="1">
        <Description Translatable="1">Parameters for the dashboard backend of the ticket pending reminder overview of the agent interface. "Limit" is the number of entries shown by default. "Group" is used to restrict the access to the plugin (e. g. Group: admin;group1;group2;). "Default" determines if the plugin is enabled by default or if the user needs to enable it manually. "CacheTTLLocal" is the cache time in minutes for the plugin.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">Paid Orders</Item>
                <Item Key="Description">All open tickets, these tickets have already been worked on, but need a response</Item>
                <Item Key="Attributes">Queues=Billing;Queues=Billing;</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">Billing</Item>
                <Item Key="Default">1</Item>
                <Item Key="CacheTTLLocal">0.5</Item>
            </Hash>
        </Setting>
    </ConfigItem>

Code: Select all

<ConfigItem Name="DashboardBackend###0700-Invoice" Required="0" Valid="1">
        <Description Translatable="1">Parameters for the dashboard backend of the ticket pending reminder overview of the agent interface. "Limit" is the number of entries shown by default. "Group" is used to restrict the access to the plugin (e. g. Group: admin;group1;group2;). "Default" determines if the plugin is enabled by default or if the user needs to enable it manually. "CacheTTLLocal" is the cache time in minutes for the plugin.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">Waiting for Invoice</Item>
                <Item Key="Description">All open tickets, these tickets have already been worked on, but need a response</Item>
                <Item Key="Attributes">States=Invoice;States=Invoice;</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 3.0.4, FreeBSD, using not for IT but as a service desk only to effectively process customer's requests.
cjseriy
Znuny newbie
Posts: 27
Joined: 05 Jan 2011, 22:03
Znuny Version: 3.04

Re: Creating Custom Dashboard Dashlets

Post by cjseriy »

The solution was to add new statetypes in database table.
OTRS 3.0.4, FreeBSD, using not for IT but as a service desk only to effectively process customer's requests.
shaned123
Znuny newbie
Posts: 25
Joined: 30 Nov 2010, 20:34
Znuny Version: 2.4

Re: Creating Custom Dashboard Dashlets

Post by shaned123 »

I am trying to put together a similar function for an Ticket Ownership Dashlet. Very simply put, the Dashlet should show all tickets owned by the Current User.
I think I am running into trouble with my Attributes and am hoping you can help.

<Item Key="Attributes">OwnerID=CurrentUser;OwnerID=CurrentUser;</Item>

Alternatively, is there an API that maps the available attributes for dashlets?

Thanks!
vinnie2k
Znuny newbie
Posts: 20
Joined: 29 Mar 2011, 13:55
Znuny Version: 2.4.7

Re: Creating Custom Dashboard Dashlets

Post by vinnie2k »

shaned123 wrote:I am trying to put together a similar function for an Ticket Ownership Dashlet. Very simply put, the Dashlet should show all tickets owned by the Current User.
I think I am running into trouble with my Attributes and am hoping you can help.

<Item Key="Attributes">OwnerID=CurrentUser;OwnerID=CurrentUser;</Item>

Alternatively, is there an API that maps the available attributes for dashlets?

Thanks!
Does this help: http://doc.otrs.org/developer/2.4/en/html/ search for AgentTSearch
OTRS 2.4.7 RedHat Linux 2.6.18-238.1.1.el5 mySQL 5.0.77
LAG_Matrix
Znuny newbie
Posts: 1
Joined: 14 Sep 2011, 11:09
Znuny Version: 3.0.10
Company: Leuchter Informatik AG

Re: Creating Custom Dashboard Dashlets

Post by LAG_Matrix »

Wish it would help :)
I'm trying to do the same (Reminder: Custom Dashboard to show every Agent he's own Tickets on first sight)

But can't find it :(
Please, would you help me? The said URL dind't work for me, it would be great to have a Solutione, once and for all
How can I check the current loged in Agent?

Thanks and greatings
--------------------
Using right now:
OTRS 3.0.10
ITSM 3.0.5
On: Server 2008 R2 (No other funktions)
Behind: Server 2008 R2 with Exchange 2010 and AD
Joool
Znuny newbie
Posts: 16
Joined: 06 Oct 2010, 15:21
Znuny Version: 3.0

Re: Creating Custom Dashboard Dashlets

Post by Joool »

shaned123 wrote:I am trying to put together a similar function for an Ticket Ownership Dashlet. Very simply put, the Dashlet should show all tickets owned by the Current User.
I think I am running into trouble with my Attributes and am hoping you can help.

<Item Key="Attributes">OwnerID=CurrentUser;OwnerID=CurrentUser;</Item>

Alternatively, is there an API that maps the available attributes for dashlets?

Thanks!
For people (like me) looking for an awnser for this here you'll find it:

http://www.mail-archive.com/otrs@otrs.org/msg32787.html

Simply install the oom over the packet management
Running: OTRS 3.0.10
Testing: OTRS 3.1.1
On Ubuntu Server 10.4
shaned123
Znuny newbie
Posts: 25
Joined: 30 Nov 2010, 20:34
Znuny Version: 2.4

Re: Creating Custom Dashboard Dashlets

Post by shaned123 »

This is exactly what I was looking for as well. Thanks!
knischan
Znuny newbie
Posts: 65
Joined: 29 Sep 2011, 05:18
Znuny Version: 3.0.11
Real Name: Ken
Company: Baltimore City Mayor's Office

Re: Creating Custom Dashboard Dashlets

Post by knischan »

Joool wrote:
shaned123 wrote:I am trying to put together a similar function for an Ticket Ownership Dashlet. Very simply put, the Dashlet should show all tickets owned by the Current User.
I think I am running into trouble with my Attributes and am hoping you can help.

<Item Key="Attributes">OwnerID=CurrentUser;OwnerID=CurrentUser;</Item>

Alternatively, is there an API that maps the available attributes for dashlets?

Thanks!
For people (like me) looking for an awnser for this here you'll find it:

http://www.mail-archive.com/otrs@otrs.org/msg32787.html

Simply install the oom over the packet management
Sorry for the newb question, but I downloaded that .opm and placed it where the other opm files I saw were on my box (otrs\var\packages). Did a perl otrs.RebuildConfig.pl. I went into the Dashboard in SysConfig, don't see any new option though. How do I enable this new view?
OTRS 3.0.11 / IIS7 / MSSQL 2005 / VMware ESX
Joool
Znuny newbie
Posts: 16
Joined: 06 Oct 2010, 15:21
Znuny Version: 3.0

Re: Creating Custom Dashboard Dashlets

Post by Joool »

knischan wrote: Sorry for the newb question, but I downloaded that .opm and placed it where the other opm files I saw were on my box (otrs\var\packages). Did a perl otrs.RebuildConfig.pl. I went into the Dashboard in SysConfig, don't see any new option though. How do I enable this new view?
It's much easier than that.

Just login as an Agent

Go to Admin ---> Packet-Management ---> Select the opm ---> Click install Package
Running: OTRS 3.0.10
Testing: OTRS 3.1.1
On Ubuntu Server 10.4
Locked