Hi there,
I have modified a web application to post to RT’s web interface a create ticket request. The post works perfectly… the ticket get created in the right queue with the given subject and text… except that the custom field value I pass (UPC) in does not get set. Here is the CURL code:
$content = 'id: new
CF-UPC: 786936180992
Text: This is the ticket text
Queue: External App Requests’;
$request = RT_LOCATION;
$request .= 'ticket/new/';
$postargs = array(
'user' => RT_USER,
'pass' => RT_PASS,
'content' => $content
);
// get the curl session object
$session = curl_init($request);
// set the POST options
curl_setopt ($session, CURLOPT_POST, true);
curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $session, CURLOPT_HTTPHEADER, array( 'Expect:' ) );
// do the POST and then close the session
$response = curl_exec($session);
curl_close($session);
In debugging this I have also created a simple form which posts to the same place:
User:Pass:
Content: id: new CF-UPC: 786936180992 Text: This is the ticket text from the form. Queue: External App Requests
When this form is used, again the ticket is created but in this case the custom field UPC does get set. But
the “Content:” being sent is the same in both. In particular in both cases I am providing UPC’s value with
"CF-UPC: 78…" Can anyone here explain what the difference could possibly be between these two
posting methods that could result in this scenario? By the way, in both cases I am passing in the same
user name and password. I am really stumped and I suspect some small stupid thing I have missed.
Thanks for your help,
Kim