Velocity template throws error /null when I want to skip a set of fields

Hi ,

We have a plugin called "Jira Charting Plugin" , which gives the some custom field types such as ,

1.Date of first Response

2.time in each Status

3.Closing Status

4.Days since last comment

We want to filter out the above fields in the issue pdf(We are extracting each issue in the PDF format) .

So when iterating the custom fields based on the custom field's id in the .vm file, we are thrown an error like the following

org.apache.velocity.runtime.exception.ReferenceException: reference

Also I searched for similar issues and found this :

When I searched for the similar problems , found this below link

The solution suggested is to

Fixed the excel all fields view to exclude custom field columns that have no view/column-view defined as they cause velocity reference exceptions.

Any idea how to fix this issue?



1 answer

This widget could not be displayed.

If you all want to do is filtering out (not showing) those fields in the PDF (generated by the JIRA PDF View Plugin), then what you should do is a simple check like this:

#if($customField.idAsLong != 10010 && $customField.idAsLong != 10011)

## here comes the export code


This sample snippet assumes that the fields not to export has ID = 10010 and 10011.

This way you code will skip them and avoid the ReferenceException.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

113 views 2 0
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