- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2015 10:17 AM
I am trying to add to the comments on an incident via the REST API, but can not clearly see how to do this. If I post a new incident and add to the "comments" field, it does not persist. Does anyone know of a way to do this? Thanks.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2015 09:30 AM
Hi Brad - did you actually check the incident that was created? The example page does work. What you are seeing in the response is because of the nature of the Comments and Work notes fields. They don't actually store the comments you put in an incident, so when the response says: comments: "" - that should not be taken as there are no comments for that incident.
What happens is when you post to the comments field, it is then stored over in the sys_journal_field table with a relationship back to the incident. The activity formatter on the incident form goes and retrieves all the comments (and other field you tell it too) and presents them on the form in date order. The trick to getting the comments back via the GET - is adding &sysparm_display_value=true which they do actually have in the screenshot, but don't state it (that I noticed).
Let me know if this doesn't make sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2016 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 11:12 PM
Hi All,
I have a similar type of REST setup in Eureka version and its working except for additional comments & work Notes. And I am trying to convert these Journal Inputs entries to String and placed it in String field in import set staging table. Below is line of code:-
var comm= inc.comments.getJournalEntry(-1).toString();
comm=comm.replace(/["']/g, "");
comm=comm.replace(/[\n*]/g, "");
comm= String(comm);
r.setStringParameter('u_additional_comments',comm);
gs.log('Comments :' + comm);
But its appearing as blank. However, on log its prints properly.I also tried by passing the hardcoded value through content type and that was working.
Any idea where its getting wrong and what?