Related Incident latest comments

shabbir9
Tera Contributor

Hi Team,

We need to share incident comments via using API we have developed this API by using REST API explorer incident table API. So, we able to fetch the response but customer wants only latest(updated) comment. Could you please help on this, how to fetch latest comment. Please provide solution as soon as possible it's little bit urgent.



Thanks & Regards,
Gori

2 REPLIES 2

Community Alums
Not applicable

Hi @shabbir9 ,

You will have challenge to get the latest comment via an API, as what i have done in past is using a BR with this sample code :

var notes = current.comments.getJournalEntry(1);
var Content = notes.split("(Comments)\n");
var lastComment = Content[1].toString();
 

Hi Sandeep,

Thank you for response.

If we use business rule, how we can generate API?, We need to share GET API to the customer so that they can fetch the data. Could you please share the complete BR script?