Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Fields with Wiki Markup

If the fields to be exported are configured to use a Wiki Markup Renderer, you can place the wiki rendering in the result document. 

...

Info

When creating an Excel template document, you should use: ${wiki:Description}

Xporter also allows generating hyperlinks on the fly.

...

Info

When creating an Excel template document, you should use: ${link:title=${Key},href=${BaseURL}/browse/${Key}}

Fields with HTML

If the fields to be exported are configured to use an HTML renderer, such as the one provided by the  JEditor plugin, you can place the HTML rendering in the result document. 

...

Warning

If the document's output format is HTML, you should use: ${wiki:Description} instead.

JavaScript with Wiki or HTML

Xporter allows applying Wiki or HTML functions in the text rendered based on JavaScript. For example, if the fields to be exported are configured to use the Default Text Renderer provided by Jira, you can use JavaScript to format the field using the notation explained here and then apply the Wiki or HTML functions. You can also use JavaScript to format fields that are configured to use the Wiki Markup Renderer or an HTML renderer, such as the one provided by the  JEditor plugin and then apply the Wiki or HTML functions. To achieve that, the JavaScript function should be defined as a field in the template and the function to be applied to that field. 

...

Code Block
titleFormatting the first word in field "Description" to "Bold", "Italic" or to have a different text color (red in the examples) using Wiki function
collapsetrue
${wiki:%{var t ='*'+'${Description}'.split(' ')[0] +'*'+' ${Description}'.substr('${Description}'.indexOf(' ') + 1);t.toString();}}
${wiki:%{var t ='_'+'${Description}'.split(' ')[0] +'_'+' ${Description}'.substr('${Description}'.indexOf(' ') + 1);t.toString();}}
${wiki:%{var t ='{color:red}'+'${Description}'.split(' ')[0] +'{color}'+' ${Description}'.substr('${Description}'.indexOf(' ') + 1);t.toString();}}


Formatting Date Fields

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

Definition: 

${dateformat("<Format>"):<Field name>}
Code Block
titleExpand to see the examples on sample code
collapsetrue
${dateformat("yyyy-MM-dd"):Created}
${dateformat("EEE, MMM d, ''yy"):Created}
${dateformat("EEE, d MMM yyyy HH:mm:ss Z"):Updated}

Formatting Number Field

Info

Available in Xporter for Jira 3.3.0 and later.

If you are exporting a Number Field, you can define 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>} 

Code Block
titleExpand to see the examples on sample code (considering Price as a custom Number Field)
collapsetrue
${numberformat("###,###.###"):Price}
${numberformat("\u20AC ###,###.###"):Price}
${numberformat("de_DE" , "###,###.###"):Price}
${numberformat("##0.#####E0"):Price}
${numberformat("en_UK" , "#0.#####%"):Price}

Formatting User Picker Fields 

Info

In Xporter for Jira 4 and later, displayname and displayemail function were replaced by fullname and emailaddress, respectively.

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>}
Code Block
titleExpand to see the example on sample code
collapsetrue
${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>}
Code Block
titleExpand to see the example on sample code
collapsetrue
${emailaddress:UserCustomField}

Escaping fields

This function allows fields with line breaks or other special characters to be used inside JavaScript.

Definition:

${escape:<Field name>}
Code Block
titleExpand to see the examples on sample code
collapsetrue
${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 these cases, all the above formatters are available.


Code Block
titleExpand to see the example on sample code
collapsetrue
${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, you can get this value in milliseconds as well as the formatted version 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>}

Code Block
titleExpand to see the example on sample code
collapsetrue
${durationformat:Custom Field}

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