---
title: "Transfer metadata from chat widget into custom field with Jira Automation"
canonical: "https://support.appfire.com/space/CHAT/345702406/Transfer%20metadata%20from%20chat%20widget%20into%20custom%20field%20with%20Jira%20Automation"
format: markdown
---
> Macro (aura-html)

## Purpose

This page provides a step-by-step guide on how to define and copy metadata from the Chat for JSM widget into a custom field defined in Jira using Automation for Jira and Smart Values. 

## Runbook

1. Define metadata in the widget. Check out an example below:

```
chatWidget.setAttribute('metadata', `[
{ name: 'Age', value: 100, render: true, },
{ name: 'Greeting', value: 'Hello world', render: true, },
{ name: 'Hidden', value: 'hidden', render: false, },
]`);
```

OR

```
<chat-widget
metadata="[
{ name: 'Age', value: 100, render: true, },
{ name: 'Greeting', value: 'Hello world', render: true, },
{ name: 'Hidden', value: 'hidden', render: false, },
]">
</chat-widget>
```

The metadata includes key and value, and depending on your example, this should be reflected in the Chats dashboard within the Chat information section:

![Access token generation interface](media://d1687d12-75c4-4ccf-80fd-b95a20b1f616)

2. Use the Jira automation to copy metadata into a custom field.
3. To fetch the metadata, use the following smart value:

```
{{issue.properties."com.spartez.supportchat.chat.metadata"."customMeta"."value"}}
```

This will copy the value from the metadata into the custom field defined in Jira.

For more than one value, use the following method to retrieve values from the array. To retrieve the value of the first meta value, use *get(n)* before “value” to retrieve a particular array value:

```
{{issue.properties."com.spartez.supportchat.chat.metadata"."customMeta".get(0)."value"}}
```

```
{{issue.properties."com.spartez.supportchat.chat.metadata"."customMeta".get(1)."value"}}
```