[rt-users] Tracking how tickets are created

Emmanuel Lacour elacour at easter-eggs.com
Mon Feb 14 15:16:08 EST 2011


On Mon, Feb 14, 2011 at 01:39:51PM -0600, Max McGrath wrote:
> Hello -
> 
> We are using RT 3.8.8 on Ubuntu 10.04.
> 
> We are looking for a simple way to track how our tickets are being created.
>  Right now tickets get created in any number of way:
> 
>    - User e-mails problem directly to RT
>    - User calls the Help Desk and we enter a ticket on their behalf
>    - User uses RT web interface to create ticket themselves
> 
> 
> We would like to be able to easily track that and look at the end of the
> month and say "Oh, 300 tickets were created through the web interface, but
> only 100 were done via e-mail".
> 
> Does anybody have any strategies for this?
> 

Setup a  ticket customfield "Origin" for this, fill it automatically with a
custom scrip. Then you can do charts on this customfield.

The scrip (untested):

Condition: On Create
Action: User Defined
Template: blank

Action commit code:

if ( $self->TransactionObj->Message->First && $self->TransactionObj->Message->First->GetHeader('Received') ) {
    $self->TicketObj->AddCustomFieldValue( Field => 'Origin', Value => 'Mail' );
} else {
    if ( $self->TransactionObj->CreatorObj->Privileged ) {
        $self->TicketObj->AddCustomFieldValue( Field => 'Origin', Value => 'Helpdesk' );
    } else {
        $self->TicketObj->AddCustomFieldValue( Field => 'Origin', Value => 'Self' );
    }
}




More information about the rt-users mailing list