Formatting Date Fields

If you are exporting a date field such as CreatedDate and LastUpdateDate, you can define the format of how the date is displayed. All the patterns supported by the SimpleDateFormat Java API are supported.

Definition: 

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


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

Formatting Number Field

Available: Xporter for 3.3.0 and later.

If you are exporting a Number Field, you can define the format of how the number is displayed. All the patterns supported by the DecimalFormat(String pattern) Java API are supported.

You can also specify the Locale you want to use. All the Locales in JRE 7 Supported Locales page are supported.

Definition: 

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

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


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

Formatting User Picker Fields 

In Xporter for 4 and later displayname and displayemail function were replaced by new functions: fullname and emailaddress.

If you are exporting a User Picker or Multiple Users custom field, you can output the Display Name using the fullname function.

Definition: 

${fullname:<Field name>}


${fullname:UserCustomField}

 

If you are exporting a User Picker or Multiple Users custom field, you can output the email using the emailaddress function.

Definition: 

${emailaddress:<Field name>}


${emailaddress:UserCustomField}

Escaping fields

If the fields to be exported need to be escaped there is a function for that. Escaping allows fields with line breaks or other special characters to be used inside Javascript.

Definition:

${escape:<Field name>}


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

Creating mappings based on Javascript using formatted fields

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 or WIKI.
In this cases, all above formatters are available.

 

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


Formatting Duration time field

If you are exporting a duration time field, you can define the behavior you want in order to get the correspondent value. Let's suppose you want to export the duration of an issue, from now on, you are able to get this value in milliseconds and even better, you can get the current duration time formatted of this value.
Furthermore, this field allows you to execute javascript action on the duration time field and export the result.
 

Definition: 

${durationformat:<Field name>}


${durationformat:Custom Field}

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