It's all about the answers!

Ask a question

How to get DNG Primary Text content from the history:changeEntry using the REST API?

Pierre Bentkowski (106517) | asked Jun 10 '15, 11:02 p.m.
edited Jun 19 '18, 3:10 p.m.


When setting a query with the history=true parameters, the result contains a set of history:changeEntry data elements.

For all attributes beside Primary Text, the changed value is in the history:value field.
      <history:changeEntry history:changeEvent="ATTRIBUTE" history:eventType="ADDED">
             <history:value type="string">AnAttributeValue</history:value>

For the Primary Text the the changed value is a url.
       <history:changeEntry history:changeEvent="ATTRIBUTE" history:eventType="ADDED">             
               <rrm:title>Primary Text</rrm:title>
               <history:value type="url">

Base on that information, I woudl like to do a Text DNG REST Query to get the data and generate a RPE reports.

The url is of the form:

I would expect that using the following would provide the "old" Primary Text:

It seam that the revision parameter is ignored and only the latest and current Primary Text is returned.

Is there a way with the DNG REST API to get the previous Primary Text content?



3 answers

permanent link
Donald Nong (14.5k614) | answered Jun 17 '15, 2:15 a.m.
You need two special HTTP request headers to retrieve it, given the fact that it's not a public API.
X-jazz-downstream-auth-client-level: 4.0
DoorsRP-Request-Type: private
The "Accept" header does not appear to matter as it always return XML/RDF format.

Note that rather than using the "history=true" parameter to get the revisions, it may be easier to just use the artifact type "revisions" to do so.

Pierre Bentkowski commented Jun 26 '15, 9:42 a.m.

Can you provide an example on how to set the Dynamic Data Source using those special HTTP request headers?

The revisions does not have the data, we found it easier to go through the change entry.
We will consider the revisions, if we cannot move forward with this one.

permanent link
Subramanya Prasad Pilar (4.6k16) | answered Jun 26 '15, 7:53 a.m.
You can use dataSource/artifact/aggregatedContent/history/changeLog/changeEntry/oldValue when value type="string". For other cases you should use script as in the OOTB template audithistory.dta.

Pierre Bentkowski commented Jun 26 '15, 9:37 a.m.

The OOTB template audithistory.dta creates a Hyperlink to the old value in DNG.
That is my current work around.
The purpose of our template is to show changes side by side, without any navigation to DNG.

Currently, we generate a Book report on two baselines (or current) and use Word compare to identify the changes. That work well when comparing baselines, but not for "in between" baseline time stamp.

permanent link
michele choban (1644) | answered Jul 01 '15, 9:00 a.m.


I too am trying to return the primary text of the old value of an artifact as well.  As an additional FYI...according to "We cannot get the old value since DNG does not support the filter by revision."

Regarding your baseline comparisons...Question:  Do you provide the users with a list of baselines to choose from when generating the book report?  I'd like to see how you did this if that is the case? I know currently there is no data source available for baselines and the information can not be reported using RPE, but just curious if you found another way other than knowing the snapshot id of the baseline as discussed in  

Pierre Bentkowski commented Jul 20 '15, 5:44 p.m.

Sorry for the late reply.

To get the Baseline data:
  Using a RPE variable (BaselineID), the user provide the baseline name  [ex: 1.0 (review) ]
  We then use the info provided here:
  Publishing DNG Module Baseline Metadata to get the snapshot Id.

  We look in feed/entry/content/moduleBaseline for (uniqueId == BaselineID)
  The snapshot id is available in
  where (name == "jfsBaseline").
  We get the data using the following script:
               _snapshotId = uri.replace(/.*baselines\//,"")

Hope that helps.


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.