[closed] [EWM] add comments using API
I'm thinking of using OSLC (REST API) to add comments to my Workitem.
At this time, can I specify the comment user and the comment creation date?
Reference
https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20#Adding_comments
The question has been closed for the following reason: "The question is answered, right answer was accepted" by davidhoney Apr 19 '23, 4:00 a.m.
Accepted answer
As far as I can tell, I have to agree with David.
As the creation date and the creator are automatically assigned, it is sufficient to POST the comment representation with just description in it to the collection url.
Comments
One other answer
I think it unlikely. I would expect the creator of the comment to be the current authenticated user, and the creation time to be the time it was added to a comment. In other words, I would expect that any
dcterms:creator
and
dcterms:created
included in the POST request JSON body would be ignored. Allowing the REST API to spoof another user would be a security issue.