You have the option to insert directly into the worklog form, which will require you to provide the proper linking fields yourself, or you could use the incident interface form doing a put with the proper actions that will cause the workflow to create the worklog entry for you....entirely your choice.
Thanka LJ and Shameem for responding.I think you are talking about adding worklog without attachment, we are able to achieve that. But our challenge is when we are adding an attachment.
We've tried to create one using this example https://communities.bmc.com/docs/DOC-60907# but still get a 400 Bad Request response.
Content-Disposition: form-data; name="entry"
Content-Type: application/json; charset=UTF-8
"Detailed Description": "TEST",
"z1D Action": "CREATE",
"Incident Number": "INC3333333",
"View Access": "Internal",
"z2AF Work Log01": "sample.txt"
name="attach-z2AF Work Log01"; filename="sample.txt"
Have you gotten that working in a client like Postman? The syntax for that stuff is really tricky and problem prone when I was working with it...at first look it seems like you have everything right....assuming of course that
is just a standin for your actual data
for what it's worth, I too have had serious problems using the REST interface for attachments (not specifically to the OOB work info forms etc, but just getting the interface to work).
The decision to accept raw binary data for the attachment rather than base-64 encoding is truly baffling. It makes constructing these kinds of requests a serious serious pain. Will be watching this thread to see if anyone figures it out. I'll be interested to see the solution.
I got it working by changing the Content-Transfer-Encoding to Base64.....I have an example of how I got it working in my RestfulPlugin