Your add-on can contribute specialized actions in multiple locations in HipChat. These actions can be used by users to act on messages or objects which are surfaced in Sidebar Views.
Input actions are triggered from the input field using the "" icon.
This action should only be used to add content directly into chat.
Card and message actions
Actions are triggered from the "" icon.
Cards can support multiple actions - click to expand or collapse.
Action buttons are used to provide actions like discuss, open in browser or open in application in the main chat view.
Actions are triggered from the "" icon from within the full view.
Declaring an action
Your add-on must declare the action in the add-on descriptor. Actions can open sidebar views, dialogs or external pages.
For example to add a message action which opens a custom Dialog View:
The target of an action can be:
- Opening a Dialog
- Opening a Sidebar
- Opening an External Page (open a new browser tab, load a URL, passing context parameters)
Processing an Action
Message actions can be context sensitive. For example, you can choose to show actions only if a message contains a link or a certain pattern:
Action conditions for cards
A common use case is exposing actions on cards. These actions may vary with the card contents, and card metadata in combination with conditions can be used for this.
|Contribute an action for cards of a particular style.|
Contribute an action for cards that are enabled only if a metadata condition matches.
Object structures are supported:
can be checked in the condition using:
Other supported conditions
|Is true for public rooms.|
|Is true if the logged-in user is an administrator.|
|Is true if the logged-in user is a guest user.|
|Is true if the logged-in user is the room owner.|
|True if the message type matches. Possible types are:
|True if the message body matches the regular expression.|
|True if the message sender matches the provided string.|
|True if the message contains a link.|
|True if the message was sent by the logged-in user.|
You can negate a condition by using the "invert" attribute on a condition: