Dashboard backend WorkingTime

Moderator: crythias

Post Reply
adminrd
Znuny newbie
Posts: 39
Joined: 29 Aug 2013, 15:14
Znuny Version: 5.0.9

Dashboard backend WorkingTime

Post by adminrd »

Hi all,

I add a custom Dashboard backend, but I wanted to use WorkingTime value instead of TicketCreateTimeOlderMinutes. Is it possible ?

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
 <ConfigItem Name="DashboardBackend###2000-HookView" Required="0" Valid="1">
        <Description Translatable="1">Parameters for the dashboard backend of the hook tickets 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">Hook tickets view</Item>
                <Item Key="Description">All hook tickets view</Item>
                <Item Key="Attributes">DynamicField_TicketFreeText6_Equals=Demande;TicketCreateTimeOlderMinutes=120;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"></Item>
                <Item Key="Default">1</Item>
                <Item Key="CacheTTLLocal">0.5</Item>
                <Item Key="DefaultColumns">
                    <Hash>
                        <Item Key="Age">2</Item>
                        <Item Key="Changed">1</Item>
                        <Item Key="CustomerID">1</Item>
                        <Item Key="CustomerName">2</Item>
                        <Item Key="CustomerUserID">1</Item>
                        <Item Key="EscalationResponseTime">1</Item>
                        <Item Key="EscalationSolutionTime">1</Item>
                        <Item Key="EscalationTime">1</Item>
                        <Item Key="EscalationUpdateTime">1</Item>
                        <Item Key="TicketNumber">2</Item>
                        <Item Key="Lock">1</Item>
                        <Item Key="Owner">2</Item>
                        <Item Key="PendingTime">1</Item>
                        <Item Key="Queue">2</Item>
                        <Item Key="Responsible">2</Item>
                        <Item Key="Priority">1</Item>
                        <Item Key="Service">1</Item>
                        <Item Key="State">1</Item>
                        <Item Key="SLA">1</Item>
                        <Item Key="Title">2</Item>
                        <Item Key="Type">1</Item>
                    </Hash>
                </Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
Thanks in advance,

Regards
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: Dashboard backend WorkingTime

Post by artjoms15 »

You can use all the values that can be passed to TicketSearch module. https://otrs.github.io/doc/api/otrs/sta ... ch.pm.html

As you can see, WorkingHours is not supported, so you should add this filter manually ( Custom Dashboard .PM module )

A.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
adminrd
Znuny newbie
Posts: 39
Joined: 29 Aug 2013, 15:14
Znuny Version: 5.0.9

Re: Dashboard backend WorkingTime

Post by adminrd »

Hi,

Thanks for your answer.

Then I created Custom/Kernel/Output/HTML/DashboardTicketGeneric.pm and add the code to retrieve my WorkingTime :

Code: Select all

elsif ( $Key =~ m{\A (DynamicField_.+?) _ (.+?) \z}sxm ) {
            $DynamicFieldsParameters{$1}->{$2} = $Value;
        }
        elsif ( $Key eq 'WorkingTime') {
            $TicketAttributes{$Key} = $Value;
        }

But now I don't know how to do the request with this criteria.
Even if I add my variable in the TicketSearch hash:

Code: Select all

%TicketSearch = (
        %TicketSearch,
        %DynamicFieldsParameters,
        %TicketAttributes,
        Permission => $Self->{Config}->{Permission} || 'ro',
        UserID => $Self->{UserID},
    )
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: Dashboard backend WorkingTime

Post by artjoms15 »

Uhmm, With current codebase it is IMPOSSIBLE to make a direct request to TicketSearch method. And based on my experience it is an ungrateful job to edit TicketSearch functionality to add another parameter.

BTW, what do you mean with WorkingTime - in OTRS there are 3 predefined workingTime fields:

EscalationTimeWorkingTime
FirstResponseTimeWorkingTime
UpdateTimeWorkingTime
SolutionTimeWorkingTime


which can be passed to TicketSearch function and

Time units (work units)

which is calculated mostly in reports

Please clarify based on which value you want make a filter

A.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Post Reply