Hello,
I am attempting to modify the single-word.vm to include Due Date in the subtasks portion of the document. Here is what I have done so far with null results:
<table class="grid" cellpadding="0" cellspacing="0" border="0" width="100%"> <tr bgcolor="#f0f0f0"> <td> <b>$i18n.getText('issue.field.key')</b><br/> </td> <td> <b>$i18n.getText('issue.field.summary')</b><br/> </td> <td> <b>$i18n.getText('issue.field.type')</b><br/> </td> <td> <b>$i18n.getText('issue.field.status')</b><br/> </td> <td> <b>$i18n.getText('issue.field.assignee')</b><br/> </td> <td> <b>$i18n.getText('issue.field.duedate')</b><br/> </td> </tr> #foreach ($subTask in $subTasks) <tr> <td> <a href="$baseurl/browse/$textutils.htmlEncode($encoder.encode($subTask.key))">$textutils.htmlEncode($subTask.key)</a> </td> <td valign="top" width="25%"> <a href="$baseurl/browse/$textutils.htmlEncode($encoder.encode($subTask.key))">$textutils.htmlEncode($stringUtils.abbreviate($subTask.summary, 40))</a> </td> <td> $textutils.htmlEncode($subTask.issueTypeObject.nameTranslation, false) </td> <td> $textutils.htmlEncode($subTask.statusObject.nameTranslation, false) </td> <td> #if ($fieldVisibility.isFieldHidden($issue.project.getLong('id'), 'assignee', $issue.issueTypeObject.id) == false) #if ($subTask.assignee) $textutils.htmlEncode($subTask.assignee.displayName) #end &nbsp; #end </td> <td> $textutils.htmlEncode($subTask.duedateObject.nameTranslation, false) </td> </tr> #end </table>
issue.field.duedate renders correctly as Due Date in the header row, but duedate.Object returns a null value or blank.
Any help or pointers to a document would be greatly appreciated!
You can try free add-on: https://marketplace.atlassian.com/plugins/andreymarkelov-atlas-plugins.templator
It helps to export docx documents.
Hi Andrey, thanks but I would prefer to just do a simple manipulation of the Velocity template and add that dueDate variable for the subtask to export. It should be simple if I could find the right variable name to extract.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This add-on allows to use velocity or docx using same variables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your app docs it only shows the variables available to task. How do I get access to the subTask variables (specifically due date)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Richard,
I haven't verified, but the subtask object is probably an Issue object documented here. If you are good with Java/velocity templates and the Atlassian framework you can probably figure out the rest from there.
As a much easier alternative, you can try our plugin Intelligent Reports. It lets you design your template directly in Microsoft Word and fill it in with issue data, subtask data and more using simple point and click rules - no scripting or API to learn.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The javadoc is geared toward Java (obviously), but I am working within Velocity. Is there anyway to see what is exposed to Velocity to be pulled using the $subTask variable?
<td> $textutils.htmlEncode($subTask.DueDateObject.nameTranslation, false) </td>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.