How to pass data from website to Jira issue via Chat Widget

In many cases, companies would like to pass data from their own website to the Jira issue when a customer creates an issue on the webpage via Chat Widget. This KB article will be describing how to pass data from your website to Jira issues when your customers start a conversation at Chat.

 

Typical Use Cases

  1. Customers have logged in to the website before contacting via Chat and would like to pass this user data from the website to Jira issue

  2. Additional data like shop cart items or order history passing from website to Jira issue when customers are contacting support.

Instructions

  1. Go to the project you have enabled Chat → Project settings Chat Settings

  2. Copy the JavaScript there and add the “meta” property in the JS like the following example

    <script type="text/javascript"> var spartezSupportChat = { portal: 9, cloud: { jiraId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', jiraUrl: 'https://your-jira-instance.atlassian.net', urls: { rest: 'https://chat-api.spartez-software.com', ws: 'wss://chat-ws.spartez-software.com' }, }, meta: [ { render: true, name: "Value Name 1", value: val1, }, { render: true, 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 } </script> <script type="text/javascript" src="https://chat-api.spartez-software.com/chat.js"></script>
  3. You can customize the name of values, and it will display inside the Jira issue and issue properties.

 

Chat meta data is stored in Jira issue properties instead of any custom fields.

 

In the new Jira issue view, you may see Chat meta data in the UI. You may as well use the Jira API to access the value by

https://{YOUR_CLOUD_NAME}.atlassian.net/rest/api/3/issue/{ISSUE_ID}/properties/com.spartez.supportchat.chat.metadata

 

If you are still using the old issue view or would like to use JQL feature with those values, you will need to do some scripting to fetch the value from Jira issue properties to the custom fields you have in Jira. You may use tools like ScriptRunner to achieve such a purpose.