Hey
@Mei Thom,
It might be possible from the GET URL, but I am not sure.
I can recommend a code-based solution though, it will involve sorting based on the timestamp key value (you'll need to look to see what they key is actually called, and what the format of it is). See here for an example:
https://stackoverflow.com/a/35437868I have a script that pulls comments for another purpose, here is a snippet:
notes_json = self.rest_client().get("/incidents/" + str(incident_id) + "/comments?handle_format=names")
for each in notes_json:
each["text"] = (str( each["text"].encode("UTF-8", 'replace') ))
------------------------------
Jared Fagel
Cyber Security Analyst I
Public Utility
------------------------------
Original Message:
Sent: Wed May 20, 2020 10:00 AM
From: Mei Thom
Subject: Can we specify sort order in GET REST API
Hi, we integrate with Resilient using java REST API. I am trying to get the list of comments of an incident using GET of this REST API:
https://<host>/rest/orgs/{org_id}/incidents/{incident_id}/comments
I would like to get back the list in the order that the latest comment goes first, and the oldest comment goes last, i.e. descending order on comment's create_date. How can I specify that? Can I do that in the URI's query params?
Thank you very much!
------------------------------
Mei Thom
------------------------------