Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to access DNG artifact history using the REST API?

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


0 votes

Comments

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


Accepted answer

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

1 vote


3 other answers

Permanent link
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;



0 votes

Comments

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


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.


Permanent link

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?


0 votes

Comments

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

 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. 

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,936
× 478
× 332

Question asked: Apr 22 '15, 9:37 p.m.

Question was seen: 8,197 times

Last updated: Jul 19 '19, 1:24 p.m.

Confirmation Cancel Confirm