It's all about the answers!

Ask a question

DNG REST API How To Get Review Data


Brad Morse (234) | asked Mar 31, 3:56 p.m.

I want to get data for DNG Reviews for custom reports that are not available and I see no way to do in the Report Builder. There is a Reviews Widget that has something close, but I cannot see a way to see how that works to customize it or create something similar. So, I need the raw data.


 I've been working with the following documentation on the REST API for DNG. 

However, for the Reviews it states:
https://server:port/rm/publish/reviews Returns the review resources that are on the server. You can use this namespace with the resourceURI filters only.


But, I see nowhere that the article describes how to find the resourceURI or even what it is(I get that REST has a similar language). So, if someone can help me to specifically create this REST call (URL) that works that would really be great. I have spent too much time with no luck.

Thanks.

Accepted answer


permanent link
Ralph Schoon (61.1k33643) | answered Apr 01, 9:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 01, 9:12 a.m.

 I am by no means an expert, but it seems to be possible to get started with that API. Here my suggestions after spending some time looking at the documentation you refer to above.


1. You need to be logged in. The easiest way to experiment with this API I see is to use Firefox and get RESTCLIENT installed.

Log into your RM server e.g. https://elm.example.com:9443/rm/web
Open a RESTCLIENT window. In the Request section select GET and enter 


(there should be an asterisk * at the end of that URL, but the forum does not display it) and run the request. After a while the request should finish and you have a result containing a page with the data of RM Resources. 

Look at the data and note lines like 


The URI is the resource URI for that element.

The end section of the URI is the resource ID. Get such an ID and do a GET in a new RESTCLIENT window filtering for the ID e.g. do a 


You only get the resource back. This is a starting point. 


https://server:port/rm/publish/reviews Returns the review resources that are on the server. You can use this namespace with the resourceURI filters only.

This means https://elm.example.com:9443/rm/publish/reviews/* will not work. I have not figured how to use https://elm.example.com:9443/rm/publish/reviews yet. Maybe the information provided here are a starting point.

Brad Morse selected this answer as the correct answer

Comments
Ralph Schoon commented Apr 01, 9:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Brad Morse commented Apr 01, 10:27 a.m.

 Hi Ralph,

Thanks for your help. I tried and could not find a resourceURI that would return anything for the review. It seems this is like trying to find a needle in a haystack unless it is documented how to correctly put together the call.


Ralph Schoon commented Apr 01, 10:31 a.m. | edited Apr 01, 10:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As I already mentioned, the documentation points out that you CANNOT QUERY DIRECTLY FOR THE REVIEWS. YOU HAVE TO QUERY FOR RESOURCES AND FILTER BY THE REVIEW URI. 



Brad Morse commented Apr 05, 9:28 a.m.

Hi Ralph,

If I understand what you are saying is that I cannot get data for the status of all reviews in a project area, but need to go a particular review? That won't help what I am trying to accomplish.

Seems like the Review widget report gets close, but just need to open to all reviews. 


Ralph Schoon commented Apr 05, 9:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

My interpretation of the reportable REST API for DNG is that you can not Just query all reviews.

You would have to query all items in the project area and then filter for items that have a review and then get the details. That is my interpretation of the API.

I tried, but was not able to get the data I wanted in the time I had allotted. 


Brad Morse commented Apr 07, 9:12 a.m.

 Is OSLC a better approach to getting Review data?


Ralph Schoon commented Apr 07, 9:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Brad,

I don't know if that data is exposed in OSLC. This is out of what I have tried. Maybe Ian knows. You would have to try and OSLC GET an item that has this data and look if there is a link or something in the item.

I think reportable REST should give you the information, but I don't have experience with the DNG flavor. I know EWM better. 


Davyd Norris commented Apr 07, 6:42 p.m.
This is one of the huge pains with Reviews in the Reportable REST API: you can get pretty much all the detail of a Review once you know the URI for it, but there is no end point that lets you get that URI.

 - No place in the Reportable REST to pull a list of all reviews for a project area, even when you can see them as a list in DNG
 - No way to get the Review URI from an artefact that's reviewed within it, even when you can see it listed in the Used In section of the artefact in the DNG UI

The only way to use Reviews is to generate a custom report from the Review itself, and then the URI is passed into the report. I am sure you can get a list of Reviews using OSLC but then that's a huge pain inside a PUB document template.

I had this exact problem when I wanted to create the Review/Approve/Publish history in the front matter of a client's contract specification - the client used DNG reviews to capture this info and you could see it beautifully in the Module itself but there was no way to retrieve it during document creation

Ralph Schoon commented Apr 08, 5:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I'd suggest to create an enhancement request. 

showing 5 of 9 show 4 more comments

One other answer



permanent link
Ian Barnard (1.4k613) | answered Apr 04, 4:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 05, 5:26 a.m.

 Hi Brad


Apologies if the UUIDs below seem different but this forum seems to like mangling them with _ in particular being difficult/variable about appearing - they are all meant to be the same :-o

It seems that you have to have the URI of the review to get details for it.

To get the URI of the review, go to Reviews and on the menu for the review is Share Link To Artifact, e.g. 
Then put this into the publishing URL, using URL encoding, like:
Or you can shorten the URI to just the UUID of the review, which doesn't require any URL encoding, i.e.:
The result is e.g.:

<?xml version="1.0" encoding="UTF-8"?>
                 xmlns:rrm="http://www.ibm.com/xmlns/rrm/1.0/"
                 xmlns:attribute="http://jazz.net/xmlns/alm/rm/attribute/v0.1"
                 xmlns:comments="http://jazz.net/xmlns/alm/rm/comments/v0.1"
                 xmlns:field="http://jazz.net/xmlns/alm/rm/field/v0.1"
                 xmlns:h="http://www.w3.org/1999/xhtml"
                 xmlns:history="http://jazz.net/xmlns/alm/rm/history/v0.1"
                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                 xmlns:review="https://jazz.ibm.com:9443/rm/publish/schema/review"
                 xmlns:reviewArtifact="https://jazz.ibm.com:9443/rm/publish/schema/reviewartifact"
                 xmlns:reviewComment="https://jazz.ibm.com:9443/rm/publish/schema/reviewcomment"
                 xmlns:reviewParticipant="https://jazz.ibm.com:9443/rm/publish/schema/reviewparticipant"
                 xmlns:rm="http://www.ibm.com/xmlns/rdm/rdf/"
                 xmlns:rrmReview="https://jazz.ibm.com:9443/rm/publish/schema/rrmreview"
                 xmlns:term="http://jazz.net/xmlns/alm/rm/term/v0.1"
                 xmlns:text="http://jazz.net/xmlns/alm/rm/text/v0.1"
                 xmlns:view="http://jazz.net/xmlns/alm/rm/view/v0.1"
                 xmlns:xhtml="http://www.w3.org/1999/xhtml"
                 appId="RRC"
                 rrm:totalCount="1"
                 vMajor="70"
                 vMinor="10">
    <ds:artifact>
        <rrm:title>myreview</rrm:title>
        <rrm:description/>
        <rrm:identifier>_B6eXcbGVEeyNVcwbWfztXA</rrm:identifier>
        <rrm:format>x-com.ibm.rdm.review/rdf+xml</rrm:format>
        <rrm:collaboration>
            <ds:creator>
                <rrm:about>https://jazz.ibm.com:9443/jts/users/ibm</rrm:about>
                <rrm:title>IBM</rrm:title>
            </ds:creator>
            <rrm:created>2022-04-01T08:23:37.878Z</rrm:created>
            <rrm:modified>2022-04-01T08:23:37.878Z</rrm:modified>
            <ds:comments>
            </ds:comments>
        </rrm:collaboration>
        <ds:location>
            <ds:project>
                <rrm:title>rm_optout_p1</rrm:title>
                <rrm:about>https://jazz.ibm.com:9443/rm/resource/itemOid/com.ibm.team.process.ProjectArea/-28tkB6Eeuh3Iiax2L3Ow</rrm:about>
                <rrm:alternative>https://jazz.ibm.com:9443/rm/rm-projects/-_28tkB6Eeuh3Iiax2L3Ow/components/__J_JEEB6Eeuh3Iiax2L3Ow</rrm:alternative>
            </ds:project>
        </ds:location>
        <ds:content/>
        <ds:aggregatedContent>
            <review:dueDate>2022-04-08T00:00:00.000Z</review:dueDate>
            <review:formal>false</review:formal>
            <review:startDate/>
            <review:instructions/>
            <review:state>Draft</review:state>
            <review:reviewParticipants/>
            <review:reviewArtifacts/>
            <review:reviewComments/>
        </ds:aggregatedContent>
        <ds:traceability/>
    </ds:artifact>
</ds:dataSource>



Comments
Ian Barnard commented Apr 04, 4:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

FYI the reviews dashboard widget uses a private (and unsupported) API.


Brad Morse commented Apr 05, 9:26 a.m.

Hi Ian,

The data I really need is for all the reviews in a project area. With the correct data I can see the status of each reviewer on the review and manage the movement forward of all the reviews. What I am looking for is data on the progress on all the reviews, not so much interested in the actual review contents.

The Reviews dashboard widget works from a report that is not public. I would beneficial to understand how that works.

 

Your answer


Register or to post your answer.