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

0 votes
Accepted answer

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 Sign up to answer
Community showcase
Published yesterday in Agile

How Scrum works? It starts with training and education

To answer “How scrum works,” most of the teams I've worked with first addressed the question: “where to start?”  That question applies to both implementation and improvements on the Scrum framew...

117 views 3 3
Read article

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