There are situations where you need to find documentation on apps that are run by people outside of your team and one of the first places to check is Confluence. There will be a Setup Guide and a Q&A section on issues submitted by others, and the issue faced was that the documentation isn't exactly 100% correct and I had to look in the comments for the right answers. There could be many comments in some pages and it was quite a hassle to go through just to find the correct answer. Manually updating the page isn't a common task in the everyday busy life of a developer. "It would be nice if we could automatically pin good answers" I thought.
What it does
Top Comments will pin the comment with the most likes (if there are more than 1 with the most likes, it will show the latest comment). Users will be able to read the content of the post, see the contributor name, amount of likes and click on a button to go to that specific comment (opens a new tab). In terms of configuration, the default message (when there are no comments), minimum likes and heading can be customized.
How we built it
It will fetch data from the API Confluence - comments (within scopes - read:confluence-content.all and read:confluence-content.summary). After that, the most liked comment gets found then converted into a component to render.
Challenges we ran into
The main challenge was trying to parse the comment into Forge UI elements. I had to manually read each comment as
atlas_doc_format and parse them into a function to convert them into UI. It was quite difficult and I wasn't able to entirely parse every single element 1:1 into the extension (e.g. tables, colors, etc) without creating unnecessary complexity.
Accomplishments that we're proud of
Coded a Forge app on Confluence :)
What we learned
I learnt more about the Atlassian Forge framework.