Togetha DocGen uses a Word document as a template for making your final document, so the first thing to do is to create your Word document template.
Creating your template
Togetha DocGen uses a Word document as a template. Word has the concept of templates, but you can just use a plain Word document.
Create your Word document, add your branding, terms and conditions, and any details you want the document to include.
Then you need to add placeholders for your fields in Jira. If you have used automations before, you’ll be familiar with smart values like {{issue.description}}.
Simply place a smart value in your Word document where you want that value substituted (see the attached example Template and Placeholder examples)
Placeholder examples
Your placeholders will be different depending on whether you are using standard Jira issue fields, Jira custom fields or JSM form fields. Custom fields will need a ‘cf.’ added at the beginning of the smart value and Form fields will need an 'f.' This will trigger the placeholders to be replaced by the correct data from the work item.
|
Placeholder |
Example |
Source |
|---|---|---|
|
Standard smart values |
|
Jira issue fields |
|
Custom fields |
|
Jira custom fields by name |
|
JSM form answers |
or
|
JSM form answers |
Fallback options for empty values
If you have a smart value placeholder in your template and there is not a corresponding field in your work item, you can define in your template how you would like this to be handled by using Fallbacks.
Use | to define ordered fallbacks and the first non-empty value will be added to the document.
{{issue.duedate | issue.created | 'date not available'}}
Method calls
The table below shows examples of how you can add methods to your smart values to get a more detailed result eg text showing in UPPERCASE or lowercase, or how to format the dates differently. Please note that the supported date tokens are dd (day), mm (month), yyyy (4-digit year), yy (2-digit year).
|
Method |
Example |
Result |
|---|---|---|
|
|
|
Uppercase string |
|
|
|
Lowercase string |
|
|
|
Date formatted as |
|
|
|
Array joined as string |
Example word document Template
Software Request Template.docx
Placeholder examples
Placeholder examples-FINAL (1).docx