Custom ticket field (free text?) in stats report

Moderator: crythias

Locked
matt
Znuny newbie
Posts: 5
Joined: 23 Jun 2011, 08:39
Znuny Version: 3.0.4

Custom ticket field (free text?) in stats report

Post by matt »

Hi I am a new OTRS user and was wondering if there is a way to display custom ticket attributes in the stats reports. I have read a lot today about freetext fields but still haven't found a way to include them in a stats report. If it is possible, will they be displayed under a heading like 'freetext1' or is there a way to change the headings as well?

1 more thing too if i may, I'd like to use sum columns to tally some of my columns but not others. For example one of my columns is ticket number and i don't require it to be added up, but it seems 'sum columns' will total every column including that one.

Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Custom ticket field (free text?) in stats report

Post by crythias »

You could export to CSV and do whatever you want with the data.
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
matt
Znuny newbie
Posts: 5
Joined: 23 Jun 2011, 08:39
Znuny Version: 3.0.4

Re: Custom ticket field (free text?) in stats report

Post by matt »

I would write my own perl script to grab the data straight from the otrs database, however I was hoping to be able to use the otrs reporting system as it is already integrated and our customer can just click on a pre-defined report at the end of the month. So is there no way to use the reporting system as it is, but just add one free text field? Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Custom ticket field (free text?) in stats report

Post by crythias »

The free texts are already available in reports.
The statistic reports can run from command line/cron.
You can change the headings from SysConfig or within cvs export.
Your ability to sum the columns that you want also work that way.
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
MichaelR
Znuny expert
Posts: 250
Joined: 12 Oct 2010, 01:35
Znuny Version: 3.0.9
Company: LRS Health

Re: Custom ticket field (free text?) in stats report

Post by MichaelR »

On a semi-related note, I've had to make a heap of changes to the PDF (print) exporting to get it the way I want, for me simply changing the associated .pm is the easiest way :)
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks :)
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
matt
Znuny newbie
Posts: 5
Joined: 23 Jun 2011, 08:39
Znuny Version: 3.0.4

Re: Custom ticket field (free text?) in stats report

Post by matt »

crythias wrote:The free texts are already available in reports..
Here are the attributes available when I create a new report. Where are the freetext fields?

Code: Select all

<select onchange="Core.Agent.Stats.SelectRadiobutton('TicketAttributes', 'Select')" name="TicketAttributes" multiple="multiple" id="TicketAttributes" size="5">
  <option value="Number" selected="selected">Number</option>
  <option value="TicketNumber" selected="selected">Ticket#</option>
  <option value="Age">Age</option>
  <option value="Title" selected="selected">Title</option>
  <option value="Created" selected="selected">Created</option>
  <option value="Changed">Changed</option>
  <option value="Closed" selected="selected">Close Time</option>
  <option value="Queue">Queue</option>
  <option value="State">State</option>
  <option value="Priority">Priority</option>
  <option value="CustomerUserID" selected="selected">Customer User</option>
  <option value="CustomerID">CustomerID</option>
  <option value="AccountedTime" selected="selected">Accounted time</option>
  <option value="EscalationDestinationIn">EscalationDestinationIn</option>
  <option value="EscalationDestinationDate">EscalationDestinationDate</option>
  <option value="EscalationTimeWorkingTime">EscalationTimeWorkingTime</option>
  <option value="EscalationTime">EscalationTime</option>
  <option value="FirstResponse">FirstResponse</option>
  <option value="FirstResponseInMin">FirstResponseInMin</option>
  <option value="FirstResponseDiffInMin">FirstResponseDiffInMin</option>
  <option value="FirstResponseTimeWorkingTime">FirstResponseTimeWorkingTime</option>
  <option value="FirstResponseTimeEscalation">FirstResponseTimeEscalation</option>
  <option value="FirstResponseTimeNotification">FirstResponseTimeNotification</option>
  <option value="FirstResponseTimeDestinationTime">FirstResponseTimeDestinationTime</option>
  <option value="FirstResponseTimeDestinationDate">FirstResponseTimeDestinationDate</option>
  <option value="FirstResponseTime">FirstResponseTime</option>
  <option value="UpdateTimeEscalation">UpdateTimeEscalation</option>
  <option value="UpdateTimeNotification">UpdateTimeNotification</option>
  <option value="UpdateTimeDestinationTime">UpdateTimeDestinationTime</option>
  <option value="UpdateTimeDestinationDate">UpdateTimeDestinationDate</option>
  <option value="UpdateTimeWorkingTime">UpdateTimeWorkingTime</option>
  <option value="UpdateTime">UpdateTime</option>
  <option value="SolutionTime">SolutionTime</option>
  <option value="SolutionInMin">SolutionInMin</option>
  <option value="SolutionDiffInMin">SolutionDiffInMin</option>
  <option value="SolutionTimeWorkingTime">SolutionTimeWorkingTime</option>
  <option value="SolutionTimeEscalation">SolutionTimeEscalation</option>
  <option value="SolutionTimeNotification">SolutionTimeNotification</option>
  <option value="SolutionTimeDestinationTime">SolutionTimeDestinationTime</option>
  <option value="SolutionTimeDestinationDate">SolutionTimeDestinationDate</option>
  <option value="FirstLock">First Lock</option>
  <option value="Lock">lock</option>
  <option value="StateType">StateType</option>
  <option value="UntilTime">UntilTime</option>
  <option value="UnlockTimeout">UnlockTimeout</option>
  <option value="EscalationResponseTime">EscalationResponseTime</option>
  <option value="EscalationSolutionTime">EscalationSolutionTime</option>
  <option value="EscalationUpdateTime">EscalationUpdateTime</option>
  <option value="RealTillTimeNotUsed">RealTillTimeNotUsed</option>
  <option value="TicketFreeTime1" selected="selected">Time1</option>
  <option value="TicketFreeTime2">Time2</option>
  <option value="TicketFreeTime3">Time3</option>
  <option value="TicketFreeTime4">Time4</option>
  <option value="TicketFreeTime5">Time5</option>
  <option value="TicketFreeTime6">Time6</option>
</select>
crythias wrote:You can change the headings from SysConfig or within cvs export.
I cannot find any settings relating to headings in Core::Stats or Frontend::Agent::Stats. Where else should I look?

Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Custom ticket field (free text?) in stats report

Post by crythias »

Kernel/System/Stats/Dynamic/TicketList.pm Line 956-

Code: Select all

    # get free text fields
    FREEKEY:
    for my $FreeKey ( 1 .. 16 ) {

        # get ticket free key config
        my $TicketFreeKey = $Self->{ConfigObject}->Get( 'TicketFreeKey' . $FreeKey );

        next FREEKEY if ref $TicketFreeKey ne 'HASH';

        my @FreeKey = keys %{$TicketFreeKey};

        if ( scalar @FreeKey == 1 ) {
            $TicketAttributes{ 'TicketFreeText' . $FreeKey } = $TicketFreeKey->{ $FreeKey[0] };
        }
        else {
            $TicketAttributes{ 'TicketFreeKey' . $FreeKey }  = 'TicketFreeKey' . $FreeKey;
            $TicketAttributes{ 'TicketFreeText' . $FreeKey } = 'TicketFreeText' . $FreeKey;
        }
    }

    # get free time fields
    FREETIME:
    for my $FreeTime ( 1 .. 6 ) {
        my $TicketFreeTimeKey = $Self->{ConfigObject}->Get( 'TicketFreeTimeKey' . $FreeTime );
        $TicketAttributes{ 'TicketFreeTime' . $FreeTime } = $TicketFreeTimeKey;
    }

    return \%TicketAttributes;
}
Edit Config Settings in Ticket -> Core::TicketFreeText
If the box is checked, and a key-value pair is assigned to a TicketFreeText field, it'll show up labeled as the "Content" for the TicketFreeTextKey.

Code: Select all

[x] TicketFreeKey1 Key             |Content
                       [something] | [something else. This will be shown in the list of attributes of stats]
Defines the free key field number 1 for tickets to add a new ticket attribute.
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
matt
Znuny newbie
Posts: 5
Joined: 23 Jun 2011, 08:39
Znuny Version: 3.0.4

Re: Custom ticket field (free text?) in stats report

Post by matt »

Excellent, thank you :)
lelikflegma
Znuny newbie
Posts: 18
Joined: 24 Feb 2012, 18:53
Znuny Version: OTRS3011

Re: Custom ticket field (free text?) in stats report

Post by lelikflegma »

Hi.
How can I add to attributes "user email"?
If I select "Customer User" I see in result file login of customer who created ticket. How can I add to attributes list field which should show email of this customer?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Custom ticket field (free text?) in stats report

Post by crythias »

@lelikflegma,
This is an old topic. You should create a new one.
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
Locked