You are on the Xporter Server documentation. If you are looking for Xporter Cloud documentation, you can find it in this page.

In this exercise, you'll learn how to format the information from the Date Picker and Number fields to be printed in a document.

To start, we are going to create a custom field of type Number Field and name it Price.

Since Jira has native Date Picker fields, like Created or Updated, we don't need to create one of those for this exercise.

Formatting Date Fields

If you are exporting a date field, you can set the format of how the date is displayed on the generated file. All the patterns included by the SimpleDateFormat Java API are supported.

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

You can use this mapping in different ways.

For instance, if you want to print only the date and not the time, use ${dateformat("yyyy-MM-dd"):Created}. If you want to print the date and time, use ${dateformat("dd-MM-yyyy HH:mm:ss"):Created} instead.

You can see here more details about formatting Date Picker fields.

Formatting Number Fields

If you are exporting a number field, you can set how the number contained in it is displayed in the generated file. All the patterns included in the DecimalFormat(String pattern) Java API are supported.

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

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

Check the documentation here for more details about formatting Number fields.

In the issue, populate the Created Date, Updated Date fields, and the Price custom field.

The native and custom fields with the notation are listed below.

Expand to see the sample code
   ${dateformat("yyyy-MM-dd"):Created}
   ${dateformat("dd-MM-yyyy  HH:mm:ss"):Created}
   ${numberformat("de_DE" , "###,###.###"):Price}
   ${numberformat("##0.#####E0"):Price}

Below is a sample of how the mappings will be displayed in a Word template:

This Template has:

  • a Header with an Image
  • Headings
  • Text styling

Below is a sample of how the generated file will be populated:

If you like this exercise, please leave a comment or a (thumbs up). Your feedback is very important to us.

Thank you in advance.

Enjoy our product. (big grin)

Here are the files related to this Exercise:

FileDescription
Exercise6Template

Exercise 6 Sample Template file

Exercise6GeneratedExercise 6 Sample generated file
  • No labels