---
title: "Formatting Fields"
canonical: "https://docs.getxporter.app/space/XPORTERCLOUD/558535/Formatting%20Fields"
format: markdown
---
> Macro (rw-ui-expands-macro)
> 
> > Macro (rw-expand)
> 
> > Macro (toc)

## Date Fields

<span style="color: #0d0d0d">If you are exporting a date field, such as CreatedDate or LastUpdateDate, you can define how the date is displayed using various patterns supported by the </span>[<span style="color: #0d0d0d">DateTimeFormatter</span>](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html)<span style="color: #0d0d0d"> Java API.</span>

Definition: `${dateformat("<Format>"):<Field name>}`

### Sample Code

```
${dateformat("yyyy-MM-dd"):Created}
${dateformat("EEE, MMM d, ''yy"):Created}
${dateformat("EEE, d MMM yyyy HH:mm:ss Z"):Updated}
```

## Number Field

> ℹ️ Available in Xporter for Jira 3.3.0 and later.

When exporting a Number Field, you can specify how the number is displayed using various patterns supported by the [DecimalFormat(String pattern)](http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html#DecimalFormat(java.lang.String)) Java API.

<span style="color: #0d0d0d">Additionally, you can specify the Locale you want to use. </span>[<span style="color: #0d0d0d">Xporter</span>](https://marketplace.atlassian.com/apps/891368/xporter-export-issues-from-jira?tab=overview&hosting=cloud)<span style="color: #0d0d0d"> supports all the Locales listed on the </span>[<span style="color: #0d0d0d">JRE 7 Supported Locales page</span>](http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html)<span style="color: #0d0d0d">.</span>

Definition

`${numberformat(` `"<pattern>"` `):<Field name>}`

`${numberformat(` `"<Locale>"` `,` `"<pattern>"` `):<Field name>}`

### Sample Code

```
${numberformat("###,###.###"):Price}
${numberformat("\u20AC ###,###.###"):Price}
${numberformat("de_DE" , "###,###.###"):Price}
${numberformat("##0.#####E0"):Price}
${numberformat("en_UK" , "#0.#####%"):Price}
```

## User Picker Fields<span style="color: #4a6785"> </span>

> ℹ️ - <span style="color: #0d0d0d">In Xporter for Jira 4 and later, the </span>*<span style="color: #0d0d0d">displayname</span>*<span style="color: #0d0d0d"> and </span>*<span style="color: #0d0d0d">displayemail</span>*<span style="color: #0d0d0d"> functions were replaced by </span>*<span style="color: #0d0d0d">fullname</span>*<span style="color: #0d0d0d"> and </span>*<span style="color: #0d0d0d">emailaddress</span>*<span style="color: #0d0d0d">, respectively.</span>
> ℹ️ - <span style="color: #0d0d0d">When exporting a </span>*<span style="color: #0d0d0d">User Picker</span>*<span style="color: #0d0d0d"> or </span>*<span style="color: #0d0d0d">Multiple Users</span>*<span style="color: #0d0d0d"> custom field, you can use the </span>*<span style="color: #0d0d0d">fullname</span>*<span style="color: #0d0d0d"> function to output the </span>*<span style="color: #0d0d0d">Display Name</span>*<span style="color: #0d0d0d">.</span>

Definition: `${fullname:<Field name>}`

### Sample Code

```
${fullname:UserCustomField}
```

<span style="color: #0d0d0d">If you are exporting a </span>*<span style="color: #0d0d0d">User Picker</span>*<span style="color: #0d0d0d"> or </span>*<span style="color: #0d0d0d">Multiple Users</span>*<span style="color: #0d0d0d"> custom field, you can use the </span>*<span style="color: #0d0d0d">emailaddress</span>*<span style="color: #0d0d0d"> function to output the email.</span>

Definition: `${emailaddress:<Field name>}`

### Sample Code

```
${emailaddress:UserCustomField}
```

## Escaping Fields

<span style="color: #0d0d0d">The escape function allows fields with line breaks or other special characters to be used inside JavaScript.</span>

Definition: `${escape:<Field name>}`

### Sample Code

```
${escape:Description}
${escape:Custom Field}
 
%{('${escape:Description}'.length > 0) ? 'This issue has description': 'This issue does not have description'
```

## <span style="color: #000000">Creating Mappings Based on JavaScript Using Formatted Fields</span>

There are times when it may be needed to format a field, execute JavaScript actions on the formatted field, and export the result as HTML.

In these cases, all the above formats are available.

### Sample Code

```
${html:%{'${escape:Description}'.replace(new RegExp('toReplace','g'),'replacer')}}
```

## Duration Time Field

If you are exporting a duration time field, you can specify the desired behavior to obtain the corresponding value. For instance, if you wish to export the duration of an issue, you can retrieve this value in milliseconds or a formatted version.

Additionally, this feature enables you to perform JavaScript actions on the duration time field and export the resulting value.

Definition: `${durationformat:<Field name>}`

### Sample Code

```
${durationformat:Custom Field}

${durationformat:%{var timeValue="<Value>"; timeValue;}}
```


<details>
<summary>Support/Troubleshooting</summary>

If you have questions or technical issues, please [contact the Support team via the Customer Portal (Jira service management)](https://jira.getxray.app/servicedesk/customer/portal/2/user/login?destination=portal%2F2%2Fcreate%2F28) or [send us a message using the in-app chat](https://docs.getxporter.app/space/XPORTERCLOUD/18251779/In-App+Chat+Support).
</details>