Changing the format of the word Document

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....

4 answers

1 accepted

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($"Verification" || $"roughestimate")
                    <td bgcolor="#f0f0f0" width="20%" valign="top"><b>$textutils.htmlEncode($</b></td>
                    <td id="${}-${}-value" class="value" bgcolor="#ffffff" width="80%">$wordView.getCustomFieldHtml($layoutItem.fieldLayoutItem, $layoutItem.orderableField, $issue)</td>

K nbhushan I got the answer finally................. Thank u so so so much frnd.... Its a big thing... Thanx alot................. :) :) :)

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)

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', $ == false && $issue.description && $issue.description.length() > 0)
<font color="Black"><b><h2><li>Description: </h2></b></font></li>
$wordView.getRenderedContent('description', $issue.description, $issue)

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".....

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

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)

$wordView.getCustomFieldHtml($layoutItem.fieldLayoutItem, $layoutItem.orderableField, $issue)


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


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.

Suggest an answer

Log in or Join to answer
Community showcase
Maarten Cautreels
Posted Thursday in Off-topic

Friday Fun: What's your favourite beer/drink

As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...

285 views 38 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot