[rt-users] Creating tickets with Perl

John Arends jarends at uiuc.edu
Fri Mar 23 16:21:24 EDT 2007


I am using the following chunk of code to create tickets with a custom 
web form that exists outside of the RT system, and it works fine.

$MIMEObj = MIME::Entity->new();
	$MIMEObj->build(
     Type => 'text/plain',
     From => $requestor,
     Subject => $subject,
     Data => $content);

  $TicketObj = new RT::Ticket( $RT::SystemUser );

$TicketObj->Create( Queue => 'General',
Subject => $subject,
Requestor => $requestor,
Due => $duedate,
MIMEObj => $MIMEObj);


I have 2 questions though. One is that when using the built in RT 
interface to create a ticket with more than one requestor, I can 
separate them with commas. It appears RT must massage this data somehow, 
because when I use the above code to create a ticket, and if my 
$requestor variable contains multiple email addresses, only the first 
one gets added as a requestor. Any suggestions on how I can go about 
adding more than one person when creating the ticket?

The other thing is tickets created using the above method appear to have 
been created by RT_System. Is there a way I can tell RT to use something 
else in that spot, perhaps the name of the user creating the ticket 
through this external form?

Thanks much.



More information about the rt-users mailing list