It's all about the answers!

Ask a question

How to access DNG artifact history using the REST API?


Pierre Bentkowski (61517) | asked Apr 22 '15, 9:37 p.m.
Hi

Referring to RRCReportableRestAPI

The generated schema for the base resources REST API contains a reference to history:
  => dataSource/artifact/aggregatedContent/history/changeLog/...

But when we run a query in a browser:
https://<server>:<port>/rm/publish/resources?resourceURI=<artifact_itemId>
there is no tag relative to the history like aggregatedContent

Is there a special query parameter that woudl allow access to the history of an artifact (base/core and module context)?

Regards



Comments
Donald Nong commented Apr 23 '15, 1:44 a.m.

I can see the same thing. Probably contact Support to get it investigated.

Accepted answer


permanent link
Ivan Bravo (1762) | answered Apr 24 '15, 12:48 p.m.
JAZZ DEVELOPER
Adding parameter "history=true" works for me, I have tested on DNG version 5.0.2 and 6.0 RC1.
Pierre Bentkowski selected this answer as the correct answer

3 other answers



permanent link
API-DEV User (2126) | answered Jul 19 '19, 1:24 p.m.

 Has anyone figured this out?

I can't seem to get the data previous version from the API. If i copy and paste that revision link into the browser I can see it, but it returns a 410 Gone from the API view. 


permanent link
Pierre Bentkowski (61517) | answered Apr 23 '15, 11:28 a.m.

IBM Support mention the use of the Specialized namespaces revisions.

i ran that query:
https://<server>:9444/rm/publish/revisions?resourceURI=<artifact id>&history=true
When I inspect the returned data, I get the following
  <ds:content>
       <revision:revision action="MODIFY">
         <revision:title>
           https://<server>:9444/rm/resources/<artifact id>?revision=<revision id>
         </revision:title>
         <revision:author>
           https://<server>:9444/jts/users/rational
         </revision:author>
         <revision:id>
           urn:uuid:_V_GlBOnJEeS3W-T9ISp6SQ
         </revision:id>
         <revision:updated>
           2015-04-22T16:11:30.360+0000
         </revision:updated>
       </revision:revision>

if i want to access the actual changes, what should I do?
I looking into the <revision:title>
In the browser it present he associated change.
But when i try to use that data in the REST query format, I had no luck

Base on this:
https://<server>:9444/rm/resources/<artifact id>?revision=<revision id>
I tried many combination like this one
https://<server>:9444/rm/publish/resources?resourceURI=<revision id>

None returned meaningful data.
Any suggestions?



Comments
Donald Nong commented Apr 24 '15, 12:49 a.m.

The revision and history are different but related. In the web GUI, "revision" is just what you see in the "Revisions" tab, while "history" is what you see in the "Audit History" tab. The revision link(s) may appear in the history content retrieved by adding the "history=true" parameter to the REST call.


permanent link
Ivan Bravo (1762) | answered Apr 23 '15, 10:38 a.m.
JAZZ DEVELOPER
Hi Pierre Bentkowski

Yes, there is an special query parameter that would allow access to the history of an artifact.
By adding the parameter history=true you will get history information for an artifact.

Example
https://<server>:<port>/rm/publish/resources?resourceURI=<artifact_itemid>&history=true;




Comments
Pierre Bentkowski commented Apr 23 '15, 10:58 a.m.

Hello

That partially worked, at least we see there is a history tag.

I have an artifact with changes to the Primary Text. (no reviews or baseline)
I ran the query, with the history flag, as you indicated.

I get this:
           ....
           <ds:aggregatedContent>
               <history:history/>
             </ds:aggregatedContent>
           </ds:artifact>
         </ds:dataSource>

The history section is empty.
Any ideas?

Regards



Donald Nong commented Apr 24 '15, 12:45 a.m.

Make sure that you are checking the "base artifact", not the "module artifact", as the "primary text" is really an attribute of the "base artifact" and the "module artifact" is just a "wrapper" of the former.


@Ivan Bravo Should the "history=true" be documented in the wiki? It will make it easier for all to find the references there.


Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.