[rt-users] SelfService - Identify Tickets

Mike McArdle mmcardle at apprhs.org
Thu Jun 26 13:07:52 EDT 2008


I got some help with a custom condition to determine if a ticket is created
from the SelfService interface from <Erik|Laptop> in the IRC Chat.  I am a
newbie to scrip writing for RT.  I do have the RT Essentials book and am
trying to figure out the syntax of the RT pseudo code.  I'd like to know how
to assign a value to a custom field indicating a SelfService submission has
occurred.  
The next step is to code the custom action preparation and custom action
clean up code.  
Below is the custom condition code.

Any insight is greatly appreciated!
Mike McArdle
Watauga Medical Center 
Help Desk Analyst

# Custom condition to determine ticket creation via self service
# Check to see if this is a create transaction
unless($self->TransactionObj->Type eq "Create") { return 0; }

# Check that it was created via the web interface
if(defined($self->TransactionObj->Message->First->GetHeader('Received'))) {
$RT::Logger->info("Ticket #". $self->TicketObj->id ." was created by
email");
return 0;
} else {
$RT::Logger->info("Ticket #". $self->TicketObj->id ." was created
via http");

# Load the users record from their Id
my $user = RT::User->new($RT::SystemUser);
$user->Load($self->TransactionObj->Creator);

# Check to see if the user is privileged
if($user->Privileged) {
$RT::Logger->info("Ticket #". $self->TicketObj->id ." was
created via full http");
return 0;
} else {
$RT::Logger->info("Ticket #". $self->TicketObj->id ." was
created via self service");
return 1;
}
}

return 0;

-- 
View this message in context: http://www.nabble.com/SelfService---Identify-Tickets-tp17720942p18138703.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.




More information about the rt-users mailing list