jmurtha
Kilo Contributor

I am puzzled by the sys_journal_field table. I want to add work notes and comments to an incident using the direct web service insert API. I believe I am successfully calling the web service but the comment or work note does not show up in the incident in default view. However, switching to the soap response view, the comment and/or work note does appear. Clearly I am missing something, what is it?

The code segments below are ones I have copied from soapUI 4.0.1, I created a project with the http://[serviceNow instance]/sys_journal_field.do?wsdl.



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="http://www.service-now.com/sys_journal_field">
<soapenv:Header/>
<soapenv:Body>
<sys:getRecords>
<sys:element_id>4c812350b8c1f400aee325aae407bad9</sys:element_id>
</sys:getRecords>
</soapenv:Body>
</soapenv:Envelope>




<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<getRecordsResponse xmlns="http://www.service-now.com/sys_journal_field">
<getRecordsResult>
<element>work_notes</element>
<element_id>4c812350b8c1f400aee325aae407bad9</element_id>
<name>task</name>
<sys_created_by>ahtrum</sys_created_by>
<sys_created_on>2012-10-09 16:42:41</sys_created_on>
<sys_id>48826350b8c1f400aee325aae407baa5</sys_id>
<value>Sys_id is 4c812350b8c1f400aee325aae407bad9</value>
</getRecordsResult>
</getRecordsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


The insert request default asks for element, element_id, name and value.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="http://www.service-now.com/sys_journal_field">
<soapenv:Header/>
<soapenv:Body>
<sys:insert>
<!--Optional:-->
<sys:element>?</sys:element>
<!--Optional:-->
<sys:element_id>?</sys:element_id>
<!--Optional:-->
<sys:name>?</sys:name>
<!--Optional:-->
<sys:value>?</sys:value>
</sys:insert>
</soapenv:Body>
</soapenv:Envelope>


From the getRecordsResult above it appears that element is 'work_notes', the element_id corresponds with incident sys_id, 'task' appears to be the name and value is the work note text. So an example of an insert request would be as follows


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sys="http://www.service-now.com/sys_journal_field">
<soapenv:Header/>
<soapenv:Body>
<sys:insert>
<!--Optional:-->
<sys:element>work_notes</sys:element>
<!--Optional:-->
<sys:element_id>4c812350b8c1f400aee325aae407bad9</sys:element_id>
<!--Optional:-->
<sys:name>task</sys:name>
<!--Optional:-->
<sys:value>Work note text goes here...</sys:value>
</sys:insert>
</soapenv:Body>
</soapenv:Envelope>