Hello, I'm trying to test a value on an object so that if it doesn't exist, I print another field. however I am having trouble making the test condition when the CustomField has no value. Can someone help me?
this line: #if($issue.getCustomFieldValue($customField.id).size() < 10)
<!-- "Fixes and Enhancements" section -->
#set($hasFixOrEnhancement = false)
#foreach($issue in $issues)
#if($issue.resolutionObject && $issue.issueTypeObject.name != "New Feature")
#if($hasFixOrEnhancement == false)
#set($section = $section + 1)
<fo:block font-size="200%" space-before="1cm" font-weight="bold">${section} Correções e melhorias</fo:block>
<fo:list-block border-top="think solid black" space-before="2mm" padding-top="2mm" start-indent="inherited-property-value(start-indent) + 5mm" provisional-distance-between-starts="$labelSize">
#set($hasFixOrEnhancement = true)
#end
<fo:list-item space-after="0.5em">
<fo:list-item-label font-weight="bold" end-indent="label-end()">
#set($customFields = $customFieldManager.getCustomFieldObjects($issue))
#foreach($customField in $customFields)
#set($customFieldValue = $issue.getCustomFieldValue($customField.id).toString().trim())
#if ($customField.getName() == "Movidesk")
#if($issue.getCustomFieldValue($customField.id).size() < 10)
<fo:block>$xmlutils.escape($issue.getCustomFieldValue($customField.id))</fo:block>
#set ($Default = "Movidesk")
<fo:block>$xmlutils.escape($Default)</fo:block>
#else
#set ($Default = $issue.key)
<fo:block>$xmlutils.escape($Default)</fo:block>
#end
#end
#end
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>$xmlutils.escape($issue.summary)</fo:block>
</fo:list-item-body>
</fo:list-item>
#end
#end
#if($hasFixOrEnhancement == true)
</fo:list-block>
#end
Hi Eduardo - Welcome to the Atlassian Community!
Can you describe the exact values and process you want to see? I am thinking it might be easier to use something like Automation For Jira.
Hi Jonh, I'm using a Better PDF Exporter template. I am trying to test whether a customizable item field is populated. If not, I will display another value.
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.