Hi all,
I've got a customized release notes template that for a specific project, only displays the contents of a custom field called release notes instead of the standard issue key and description.
The code works great, except that if there's an issue in the release with no value in that custom field, it just displays an empty bullet point. I've been trying to find the right code so that if that custom field is empty/null it just gets skipped, but everything I've tried somehow isn't working.
Any tips?
Here's my current code. My guess is that I need to either slightly modify line 5 or add something in front of line 33 that is along the lines of
#if ($issue.getCustomFieldValue("customfield_11600").length() >0))
But everything I've tried there doesn't work.
Thanks!
Brandon
Try like this
#if ($issue.getCustomFieldValue("customfield_11600") != null)
Thanks Alexey! I tried that, but I get an error now when I open up the release notes.
Do I need to call something at the top of my .vm to use null? Or any other thoughts on why it's breaking for me?
An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.ParseErrorException: Encountered "null" at templates/jira/project/releasenotes/releasenotes-html-Copy.vm[line 33, column 89] Was expecting one of: "[" ... "{" ... "(" ... <STRING_LITERAL> ... "true" ... "false" ... <INTEGER_LITERAL> ... <FLOATING_POINT_LITERAL> ... <IDENTIFIER> ... "{" ... <LOGICAL_NOT> ... at org.apache.velocity.Template.process(Template.java:141) at
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you try like this:
#if (! $issue.getCustomFieldValue("customfield_11600"))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.