[Done] Get notification about the comment

We have a couple of requests from users, so we decided to share this workaround with you. If anyone has comments, questions, or better ways - please, feel free to share them here on this topic :slight_smile:

The content about the comment can be retrieved using script using <% %> inside the notification body

Comment is added:

<%

const fibery = context.getService('fibery');

const entity = await fibery.getEntityById(Entity.Type, Entity.Id, ['Comments']);

const documentSecret = entity.Comments[entity.Comments.length - 1]['Document Secret'];

const commentContent = await fibery.getDocumentContent(documentSecret);

%><%= commentContent%>

And this is how the result looks like

5 Likes

Easier way added ad-hoc, you can check details in this Changelog post

What is useful to add here, is that notifications for people assigned to an Entity, if said column exists, can already receive notifications:

Also:

And also:

It appears this comment refers to the headline :robot: Automations: Rich text fields can be used in templates. Is this correct?

Then this is also documented in the headline Using entity fields on

https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=Using-entity-fields--051b5b02-7c45-4aaa-8a1d-8d0066d402e1

and the headline Using rich text fields

https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=Using-rich-text-fields--2f28d99c-6af4-4aa8-86eb-1e24a1f06d1e

Here this eventually needs additional logic via JavaScript to fetch the last comment, which is explained under More complex formatting

https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=More-complex-formatting--6c28d440-c881-4be1-9f93-b11d7be82cd1

There are is also an example for Slack, which uses a similar, “complicated” notation as in the example above.

With all the above taken together, it is not clear to me how a “more easy template” could look like.

@Polina_Zenevich Could you provide an example, about how one can simplify the printing of a comment’s text into a notification, in so it appears similarly as above?