I dont need to make display all the custom fields in my word document though they are visible in Jira interface. Only few defined fields like rough estimate time, verification are needed to take though URL fields are available in my issue... Is it possible to show only our prefered fields in word document...
Please some1 help....
Try this
## List custom fields #foreach ($tabs in $fieldScreenRenderer.fieldScreenRenderTabs) #foreach ($layoutItem in $tabs.fieldScreenRenderLayoutItems) #if ($layoutItem.orderableField.hasValue($issue) && $layoutItem.orderableField.customFieldType.descriptor.viewTemplateExists == true) #if($layoutItem.orderableField.name=="Verification" || $layoutItem.orderableField.name=="roughestimate") <tr> <td bgcolor="#f0f0f0" width="20%" valign="top"><b>$textutils.htmlEncode($layoutItem.orderableField.name):</b></td> <td id="${layoutItem.orderableField.id}-${issue.id}-value" class="value" bgcolor="#ffffff" width="80%">$wordView.getCustomFieldHtml($layoutItem.fieldLayoutItem, $layoutItem.orderableField, $issue)</td> </tr> #end #end #end #end
K nbhushan I got the answer finally................. Thank u so so so much frnd.... Its a big thing... Thanx alot................. :) :) :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried to get the value from a custom field without using a loop, and I get some extra text returned: When using the foreach loop above, the returned string is: John Smith When using the below method, the returned string is: {null=John Smith} $customFieldManager.getCustomFieldObject("customfield_10003").getValue($issue)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For future reference a much easier way to do this than programming with velocity templates is to use a plugin designed specifically for this purpose. Intelligent Reports lets you easily design your export template in Microsoft Word and and point and click choose which data goes where in the document, no programming required. It supports custom fields and many other features.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
kkk thanx Nic... I hv one more question...
I wnt to show only 2 custom fields in the Word doc. Not all the custom fields in the issues...
Bt since they had applied a for each loop I cnt get wt I need
## List custom fields
#foreach ($tabs in $fieldScreenRenderer.fieldScreenRenderTabs)
#foreach ($layoutItem in $tabs.fieldScreenRenderLayoutItems)
#if ($layoutItem.orderableField.hasValue($issue) && $layoutItem.orderableField.customFieldType.descriptor.viewTemplateExists == true)
<h2><li><b>$textutils.htmlEncode($layoutItem.orderableField.name):</b></h2></li>
$wordView.getCustomFieldHtml($layoutItem.fieldLayoutItem, $layoutItem.orderableField, $issue)
#end
#end
#end
cn u plz tell me a way to adjust it..... In where do I need to chage... My new custom fields were textfields name Verification and roughestimate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hiroshi,
Documentation for this is available at
https://confluence.atlassian.com/display/JIRAKB/Customise+Word+Export+Template+for+JIRA
You can also refer to this question which is closely related
https://answers.atlassian.com/questions/96813/put-project-name-in-word-document?page=1#comment-96836
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx nbhushan ... this is nt the answer I need.... cn u tell me
## issue_descriptiontable_word
<div id="descriptionArea">
#if ($fieldVisibility.isFieldHidden($issue.project.getLong('id'), 'description', $issue.issueTypeObject.id) == false && $issue.description && $issue.description.length() > 0)
<font color="Black"><b><h2><li>Description: </h2></b></font></li>
$wordView.getRenderedContent('description', $issue.description, $issue)
#end
the meaning of this cording and is it relate to show all the custom fields in the word document ? can't I customize it nbhushan?
It ws available under issueviews in "single-word-vm".....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's a chunk of "velocity template language". It really is mostly a template for generating html - statements that start with a # are procedural within velocity, things that start with a $ are either variables, or the results of calls back into the java application behind it, and everything else is simply output into the result.
The segment you've got there is am html <div> block, with "if the description field is available and the description for the current issue has something in it, then output the description, rendered for word" as the content.
For the custom fields, I'd simply read the rest of the .vm stuff you have found - it's in there somewhere, and you'll need to read the documentation that @nbhushan pointed you to alongside the .vm files
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.