Support

 View Only
  • 1.  Navigate between requirements sets in a project - Velocity Reports

    Posted 10 days ago
    I have a context sensitive velocity report that i need to upgrade to access three sets of item types.
    1) Requirements
    2) Revision History
    3) Title Page details
    The report is run from the context of a filtered view of our requirements, and also needs to lookup the revision history items and title page item. 
    I have not been able to identify a means of to query item types under a project.
    Jama Project
    - Set of Requirement Items
    - Set of Revision History Items
    - Set of one Title Page item



    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------


  • 2.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 9 days ago
    Hi Jeff, 
    not sure if this is what you are looking for, but you could do something like this:
    ##########################
    ##Define the item type IDs (take from your instance)###
    #set( $ReqType = 86) 
    #set( $RevHist = 87) 
    #set( $TitPag = 31)
    ####################
    
    #foreach( $vDoc in $documentList)
    	#set( $doc = $vDoc.document)
    	#if( $doc.documentType.id == $ReqType)
    		##insert code for Requirement Items here
    	#elseif( $doc.documentType.id == $RevHist)
    		##insert code for Revision History Items here
    	#elseif( $doc.documentType.id == $TitPag)
    		##insert code for Titel Page Items here
    	#end
    #end​
    The IDs for the item types can be found in the Admin section -> Item Types -> Column 'API-ID'

    ------------------------------
    Patrick
    ------------------------------



  • 3.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 8 days ago
    Thanks Patrick, this is close to what I need. However, I'm in the ReqType set and need to be able find the other two sets under $project.​

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 4.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 9 days ago
    Hey Jeff,

    I'm no Velocity expert but aside from what Patrick advised, does your filter also include the Revision History items and Title Page item?  If not, I don't believe a context sensitive Velocity template will grab the other items if they're not part of the filter results unless you created relationships between them and the filtered requirements.  Hopefully the community can correct me if I'm wrong about that though.

    ------------------------------
    Alex
    Fujifilm Sonosite
    ------------------------------



  • 5.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 8 days ago
    No, these are different requirement sets and this is a context sensitive report so it uses what ever filter is in place and only runs against the ReqType set directly. I want to lookup the other sets directly under the project ($project).

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 6.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 7 days ago
    Edited by Patrick Szabo 7 days ago
    Maybe you can try something like this for the project items. For the context sensitive requirements items, use my example above.
    #set( $projectDocs = [])
    #set( $projectDocIds = [])
    #####Get the docs in the project
    #set($projectDocIds = $docDao.getContourItemIdsForProject($mathTool.toInteger($project.id))) 
    
    ##Get the Contour Items by DocId and add to the ProjectDocs array
    #foreach ($projectDocId in $projectDocIds)
        #set ($z = $docDao.getContourItem($mathTool.toInteger($projectDocId)))
        #if( $z.active )
            #if( $projectDocs.add($z)) #end
        #end
    #end
    
    #foreach ($projectDoc in $projectDocs)
        #set ( $pdoc = $projectDoc.document)  ##maybe this step is not needed. If so, replace $pdoc with $projectDoc below
        #if( $pdoc.documentType.id == $RevHist)
            ##insert code for Revision History Items here
        #elseif( $pdoc.documentType.id == $TitPag)
            ##insert code for Titel Page Items here
        #end
    #end​​


    ------------------------------
    Patrick
    ------------------------------



  • 7.  RE: Navigate between requirements sets in a project - Velocity Reports
    Best Answer

    Posted 3 days ago
    Hi Jeff!

    I understand that you want to look up the set (not the individual items in the set).

    You can try this method:
    $documentSource.getDocumentInfoList(java.lang.Integer documentTypeId, java.lang.Integer projectId, java.lang.Integer limit)

    Pass a document type ID (probably you are looking for sets) and the project ID. If you pass -1 as the limit the method will return all documentInfo objects meeting the criteria, in your case all sets in the project.

    From the documentInfo objects you can read the Contour Item IDs, with these you can query the ChildDocumentType for each set & find the one you are looking for.

    Hope this helps -

    Kind regards,



    ------------------------------
    Peter Lampacher
    MED-EL
    Innsbruck
    ------------------------------



  • 8.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 2 days ago
    Thanks Peter, that did the trick.

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------



  • 9.  RE: Navigate between requirements sets in a project - Velocity Reports

    Posted 2 days ago
    Right, I don't want to find the items in the document list. I want to navigate to the project level then down to the appropriate item sets.

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------