I have successfully used the OTRS SOAP interface to create a ticket with an article using the code below.
Code: Select all
# Create a new ticket. The function returns the Ticket ID.
$TicketID = $client->__soapCall("Dispatch", array($username, $password,
"TicketObject", "TicketCreate",
"Title", $title,
"Queue", "IT Infrastructure::Infrastructure Change",
"Lock", "Unlock",
"PriorityID", 2,
"State", "new",
"CustomerUser", $from,
"OwnerID", 10,
"UserID", 1,
));
# A ticket is not usefull without at least one article. The function
# returns an Article ID.
$ArticleID = $client->__soapCall("Dispatch",
array($username, $password,
"TicketObject", "ArticleCreate",
"TicketID", $TicketID,
"ArticleType", "webrequest",
"SenderType", "customer",
"HistoryType", "WebRequestCustomer",
"HistoryComment", "Ticket Created using the IT Change Request System",
"From", $from,
"Subject", $title,
"ContentType", "text/plain; charset=ISO-8859-1",
"Body", "This is the body",
"UserID", 1,
"Loop", 0,
"AutoResponseType", 'auto reply',
"OrigHeader", array(
'From' => $from,
'To' => 'Postmaster',
'Subject' => $title,
'Body' => "This is the body"
),
));
Thanks,
Nathan