How to open the chat widget frame from any object in your website
Problem
Currently, the only way to open the Chat for Jira Service Management (JSM) chat area is by manually clicking the chat button. However, users often want to initiate the chat through other means, such as:
Hyperlinks or call-to-action buttons embedded on the webpage.
Automated triggers executed via scripts based on user activity on the webpage.
Solution
To open the chat widget from any object on your website (not the Chat button only, but the entire chat window), the following JS script should be executed:
document.querySelector('chat-widget').shadowRoot.querySelector('.chat-icon-button').click();
This will act like clicking on a chat button, so the chat will open automatically with the relevant information and be ready to use.
This only applies to external widgets, as the Jira portal does not allow the injection of any JS scripts into the portal. Using this solution requires the option to modify the HTML/JS.