Insert chat widget in Confluence Server / Data Center

This can only be done in Confluence Server or Data Center as Cloud does not allow for HTML injection like this

Problem

You would like to add the chat widget to Confluence pages, so it can be available on your documentation pages.

This is helpful because customers can reach out to your support team right from the documentation in case they have any doubts.

Solution

Get the Chat Code

In Jira, navigate to _Project → Project Settings → Chat and copy the JavaScript code. For example:

<script type="text/javascript"> var spartezSupportChat = { portal: 2, cloud: { jiraId: '91jajf90-8a09-3f0d-96ed-9bf86dca66b9', jiraUrl: '<https://myjira.atlassian.net',> urls: { rest: '<https://chat-api.spartez-software.com',> ws: 'wss://chat-ws.spartez-software.com' }, } //meta: [ // optional, custom metadata to store in the issue created from conversation. // { render: true, name: "Value Name 1", value: val1 }, // "render" values will be displayed in the chat dashboard // { render: false, name: "Value Name 2", value: val2 }, //], // delay: 100, // delay between page load and chat load in milliseconds // container: 'spartez-support-chat-container', // ID of the page element that will be replaced by chat // iconClass: '', // additional class added to the chat icon // chatClass: '', // additional class added to the chat widget // locale: 'en-us' // force a specified locale for displaying texts to the user instead of detecting it from the browser } </script> <script type="text/javascript" src="<https://chat-api.spartez-software.com/chat.js"></script>>

Insert into Confluence

In Confluence, navigate to Administration → System → Custom HTML

There, will find the following screen:

You can choose to install on:

  • At the beginning of the BODY

  • At the end of the BODY

After configured, you will find the Chat widget showing up in Confluence pages:

Â