<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi there,<br><br>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:<br><br>----<br><br> $content = 'id: new<br>CF-UPC: 786936180992<br>Text: This is the ticket text<br>Subject: This is the subject<br>Queue: External App Requests';<br><br> $request = RT_LOCATION;<br> $request .= 'ticket/new/';<br><br> $postargs = array(<br> 'user' => RT_USER,<br> 'pass' => RT_PASS,<br> 'content'
=> $content<br> );<br><br> // get the curl session object<br> $session = curl_init($request);<br><br> // set the POST options<br> curl_setopt ($session, CURLOPT_POST, true);<br> curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs);<br> curl_setopt($session, CURLOPT_HEADER, true);<br> curl_setopt($session, CURLOPT_RETURNTRANSFER, true);<br> curl_setopt( $session, CURLOPT_HTTPHEADER, array( 'Expect:' ) );<br><br> // do the POST and then close the session<br> $response = curl_exec($session);<br> curl_close($session);<br><br>---<br><br>In debugging this I have also created a simple form which posts to the same place:<br><br><pre id="line1"><<span class="start-tag">form</span><span class="attribute-name"> method</span>=<span
class="attribute-value">"POST"</span><span class="attribute-name">action</span>=<span class="attribute-value"><span>"<a target="_blank" href="http://foo.foo.edu/REST/1.0/ticket/new/">http://foo.foo.edu/REST/1.0/ticket/new/</a>"</span></span>><br>User: <<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">name</span>=<span class="attribute-value">"user" </span><span class="attribute-name">size</span>=<span class="attribute-value">"20"</span>><<span class="start-tag">br</span>><br>Pass: <<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text" </span><span class="attribute-name">name</span>=<span class="attribute-value">"pass" </span><span class="attribute-name">size</span>=<span class="attribute-value">"20"</span>><<span class="start-tag">br</span>><br>Content: <<span
class="start-tag">textarea</span><span class="attribute-name"> rows</span>=<span class="attribute-value">"10" </span><span class="attribute-name">name</span>=<span class="attribute-value">"content" </span><span class="attribute-name">cols</span>=<span class="attribute-value">"30"</span>>id: new<br>CF-UPC: 786936180992<br>Text: This is the ticket text from the form.<br>Subject: This is the subject<br>Queue: External App Requests</<span class="end-tag">textarea</span>><<span class="start-tag">br</span>><br><<span class="start-tag">p</span>><<span class="start-tag">input</span><span class="attribute-name"> type</span>=<span class="attribute-value">"submit" </span><span class="attribute-name">value</span>=<span class="attribute-value">"Submit" </span><span class="attribute-name">name</span>=<span class="attribute-value">"B1"</span>><span class="start-tag"></span><br></<span class="end-tag">form</span>> <br><br><span
style="font-family: arial,helvetica,sans-serif;">When this form is used, again the ticket is created but in this case the custom field UPC does </span><span style="font-family: arial,helvetica,sans-serif;">get set. But <br>the "Content:" being sent is the same in both. In particular in both cases I am providing UPC's value with <br>"CF-UPC: 78..." Can anyone here explain what the difference could possibly be between these two<br>posting methods that could result in this scenario? By the way, in both cases I am passing in the same <br>user name and password. I am really stumped and I suspect some small stupid thing I have missed.<br><br>Thanks for your help,<br>Kim<br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: monospace;"></span></span></pre><br><br></div></div></body></html>