Boards Comments Functions
Each of these functions require the <commentsbutton /> tag to be present on the view. The button does not have to be visible to the user but it must be present in the view HTML. See <commentsbutton> for details.
OpenDrawer
| OpenDrawer | |
|---|---|
| No parameters |
Opens the comments drawer slide out panel for the current view. This feature is available in Unified Command Platform 10.18 and later. |
Example
<script>
BoardScript.Comments.OpenDrawer();
</script>
CloseDrawer
| CloseDrawer | |
|---|---|
| No parameters |
Closes the comments drawer slide out UI for the current view. This feature is available in Unified Command Platform 10.18 and later. |
Example
<script>
BoardScript.Comments.CloseDrawer();
</script>
GetUnreadCount
| GetUnreadCount | ||
|---|---|---|
| callback | #optional |
Get the unread comment count for the current view/user. Result can be received via callback or async/await Promise return. This feature is available in Unified Command Platform 10.18 and later. |
Example
<script>
// callback
BoardScript.Comments.GetUnreadCount(function (count) {
console.log('Unread count is:', count);
});
// async/await
const count = await BoardScript.Comments.GetUnreadCount();
console.log('Unread count is:', count);
</script>
GetCounts (ByName)
Get the comment counts for a user by specifying a board, view, dataid.
Overload for GetCounts() that specifies board, view, dataid via args parameter.
| GetCounts (By Name) | ||
|---|---|---|
| args | object |
Single parameter arguments object for specifying board/view/dataid. Language: JavaScript title: args Copy Code
This feature is available in Unified Command Platform 10.19 and later. |
| callback | #optional | Result can be received via callback or async/await Promise return. |
JavaScript Example
<script>
const args = {
"boardName": "My board"
"viewName": "My View"
};
// callback
BoardScript.Comments.GetCounts(args, function (countsObject) {
console.log('Unread count is:', countsObject.unreadCount);
console.log('Total count is:', countsObject.totalCount);
});
// async/await
const countsObject = await BoardScript.Comments.GetCounts(args);
console.log('Unread count is:', countsObject.unreadCount);
console.log('Total count is:', countsObject.totalCount);
</script>
GetCounts
| GetCounts | ||
|---|---|---|
| callback | #optional |
Get the comment count for the current view/user. Result can be received via callback or async/await Promise return. This feature is available in Unified Command Platform 10.18 and later. |
Example
<script>
// callback
BoardScript.Comments.GetCounts(function (countsObject) {
console.log('Unread count is:', countsObject.unreadCount);
console.log('Total count is:', countsObject.totalCount);
});
// async/await
const countsObject = await BoardScript.Comments.GetCounts();
console.log('Unread count is:', countsObject.unreadCount);
console.log('Total count is:', countsObject.totalCount);
</script>