I'm trying to generate a report from a set of item types that includes a folder hierarchy.
I have set my report to be context sensitive so that $documentList includes all item types. However I am unable to return any fields at all through either $doc.getCustomFields() or $velocityReportUtil.getValueForField().I would greatly appreciate a generic example that simply iterates over the fields (picklists, string#, and integers) of an ContourItem and prints those out in an HTML velocity template.
Quick Guide:https://community.jamasoftware.com/blogs/shawnna-williams/2021/06/25/navigating-the-velocity-api-documentationVelocity Report Util:http://velocity.jamasoftware.com/latest/OldVelocity/com/jamasoftware/contour/report/util/VelocityReportUtil.htmlJama APIhttp://velocity.jamasoftware.com/latest/OldVelocity/overview-summary.html
Where can I find the list of available Jama variables and tool access methods for Velocity Reports? For example $documentList.I'm trying to generate a report from a set of item types that includes a folder hierarchy. I'm also interested in any pointers to my current report issue of not having any items being returned from the $documentList.
My html template includes the following script, but I am not able to return any field values. The example below is attempting to return "requirement_type" which is a pick list. Script:#set($dateFormat=$dateTool.get('default','short'))#set($docDao = $applicationContext.getBean("documentDao"))Project: $project.name<br/>Description: $project.description<br/>Date Format: $dateFormat <br/>#foreach( $vDoc in $documentList )#set( $type = $velocityReportUtil.getValueForField($doc, "requirement_type", $dateFormat ))type : $type</br>$doc.document.name<br/>#endOutput:Project: My Project TemplateDescription:Date Format: Oct 7, 2022, 2:12 PM
Thanks for the pointer Alessandro,I found my first problem which as not setting $doc = $vDoc.document. To my surprise, the custom fields were also retrievable using $velocityReportUtil.getValueForField($doc, "req_list_type", $dateFormat ))However, my new challenge is not being able to access the attachments (figures) on each item. Neither of these two methods work for me:
#set( $attachmentList = $attachmentDAO.getDocument_DocAttachments($mathTool.toInteger($docI.Id) )#set($attachmentId= $doc.getAttachment())Jeff
Hey Jeff, are you using a Jama version < 8.42?
DAOs are not available in newer versions.Here you can use $documentSource.getAttachment($mathTool.toInteger($nAttId))
HEADQUARTERS|135 SW Taylor Suite 200, Portland, Oregon, 97204