0

I have a Salesforce instance using the old CaseComments instead of a Chatter feed. How do I get attachments and inline attachments to a CaseComment via Rest API?

I can get the CaseComments to a Case from /services/data/v57.0/sobjects/Case/<case ID>/CaseComments. But the CaseComment type doesn't have fields or relationships for attachments and inline attachments. Also, the CommentBody field is just plain text and therefore does not contain the inline attachments.

I managed to get all non-inline attachments for a Case via

SELECT Id, (SELECT Id, Title, FileExtension from CombinedAttachments) FROM Case WHERE Id = <case ID>

But that doesn't give me a relationship to the comments, so I can't tell to which comment this attachment belongs (I can only guess from the timestamp). I also still have no idea where I can find the inline attachments.

2 Answers 2

0

Attachments to Case comments lie within Salesforce in the form of Case Comment Publisher component.

https://help.salesforce.com/s/articleView?id=sf.rss_case_publisher.htm&type=5

3
  • Thanks for the reply! How do I access that via API? And does that work for inline attachments as well? I'm mostly interested in those.
    – Erik
    Jun 12, 2023 at 11:05
  • Attachments gets stored as attachment record on the case object. Case Comments and Attachments are usual Standard objects that you can use it along with any API calls
    – AjaySFDC
    Jun 13, 2023 at 7:33
  • You say "on the case object". Are you referring to what I did in my question where I select CombinedAttachments for the case? So is there no way to get inline attachments for the comments?
    – Erik
    Jun 13, 2023 at 11:34
0

CaseComments are plain text, not rich text. It turned out that in this particular instance, rich text was added via a custom object, which I had to query in order to access the comment as rich text and to then download the attachments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .