Navigate between requirements sets in a project - Velocity Reports

Jeff Abbott
Jeff Abbott Member, Data Exchange Posts: 31
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
------------------------------

Comments

  • Patrick Szabo
    Patrick Szabo Member, Medical Devices & Life Sciences Solution Posts: 55
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
    Patrick
  • Alex Frain
    Alex Frain Member, Data Exchange, Jama Connect Interchange™ (JCI) Posts: 27
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
    Alex
    Fujifilm Sonosite
  • Jeff Abbott
    Jeff Abbott Member, Data Exchange Posts: 31
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-23-2023 23:31
    From: Patrick Szabo
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
  • Jeff Abbott
    Jeff Abbott Member, Data Exchange Posts: 31
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-24-2023 10:19
    From: Alex Frain
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
  • Patrick Szabo
    Patrick Szabo Member, Medical Devices & Life Sciences Solution Posts: 55
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-25-2023 09:42
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-24-2023 10:19
    From: Alex Frain
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
    Patrick
  • Peter Lampacher
    Peter Lampacher Member, Jama Connect Interchange™ (JCI), Jama Validation Kit (JVK) + Functional Safety Kit (FSK) Posts: 14
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-25-2023 09:42
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-24-2023 10:19
    From: Alex Frain
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
  • Jeff Abbott
    Jeff Abbott Member, Data Exchange Posts: 31
    edited January 2023
    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
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-24-2023 10:19
    From: Alex Frain
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------
  • Jeff Abbott
    Jeff Abbott Member, Data Exchange Posts: 31
    edited January 2023
    Thanks Peter, that did the trick.

    ------------------------------
    Jeff Abbott
    Leidos
    Orlando FL
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-30-2023 00:08
    From: Peter Lampacher
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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
    ------------------------------

    Original Message:
    Sent: 01-25-2023 09:42
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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

    Original Message:
    Sent: 01-24-2023 10:19
    From: Alex Frain
    Subject: Navigate between requirements sets in a project - Velocity Reports

    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

    Original Message:
    Sent: 01-23-2023 09:43
    From: Jeff Abbott
    Subject: Navigate between requirements sets in a project - Velocity Reports
    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
    ------------------------------