I am trying to create a chatter post using an APEX trigger, and I'm almost there. I've gotten to this point:
ConnectApi.ChatterFeeds.postFeedItem(null, ConnectApi.FeedType.News, 'me', feedItemInput, null);
Which successfully creates the post that I want it to create, including an @mention. However, it posts it to the context user's ('me') chatter feed, whereas I want it to post to the feed of the record that set off the trigger.
Is it possible to set the 'parentId' field like you used to be able to with FeedItem? If so, how should I go about doing this? If not, is there an alternative?
Thanks!