It's all about the answers!

Ask a question

How to fetch "Modified By" from a DNG Resource with REST API

Chid . (2052961) | asked Dec 23 '21, 1:21 a.m.

I wanted to printed the last Modified By a DNG Resource in RPE.

Type System of the component shows an Attributes named Contributor. Does this store the last Modified By value ?
Reportable REST API shows creator, created, modified timestamp, but not the Modified By.

2 answers

permanent link
Ian Barnard (1.2k613) | answered Dec 23 '21, 3:39 a.m.
edited Dec 23 '21, 11:49 a.m.

Hi Chid

You don't say which version/ifix you're using - details below are from 7.0.2 iFix009, but I'm not aware this has changed recently.

Reportable REST API shows creator, created, modified timestamp, but not the Modified By.

More precisely, "DOORS Next Reportable REST API for resources shows creator, created, modified timestamp, but not the Modified By."

However the DN reportable rest output for resources includes a tag collaboration/revisions/href like this:
Use the href which is to the Reportable REST API for revisions and you get the revisions which includes the author of the revision like this:

    <ds:artifact attribute:itemId="TX1zGPUB6Eeuh3Iiax2L3Ow">
        <rrm:title attribute:itemId="title">Operations</rrm:title>
        <rrm:description attribute:itemId="description"/>
        <rrm:identifier attribute:itemId="identifier">4197</rrm:identifier>
        <rrm:format attribute:itemId="ArtifactFormat">Text</rrm:format>
            <rrm:creator attribute:itemId="creator">
            <rrm:created attribute:itemId="created">2020-12-17T15:18:11.127+0000</rrm:created>
            <rrm:modified attribute:itemId="modified">2020-12-17T15:18:11.127+0000</rrm:modified>
                <attribute:objectType attribute:itemId="OTx7TK0B6Eeuh3Iiax2L3Ow"
                    <attribute:customAttribute attribute:datatype=""
                <rrm:title>Software Requirements Specification Template artifacts</rrm:title>

Use the href which is to the Reportable REST API for revisions and you get the details of all revisions for that artifact, like this:

    <ds:artifact attribute:itemId="MDy90_0B6Eeuh3Iiax2L3Ow">
            <revision:revision action="">
            <revision:revision action="">
            <revision:revision action="">


If the revisions are in a configuration-managed project then adding  &oslc_config.context=https://host:port/gc/configuration/4462 is the correct way to specify configuration. Not sure where you got header oslc.configuration from but that's not right. Not sure Reportable rest uses a header for configuration at all. If it does the correct header would most likely be Configuration.Context

If you get 200 with no content in the XML (i.e. response body is <ds:dataSource appId="RRC" rrm:totalCount="1" vMajor="60" vMinor="06"/>) it's because there's nothing for that resource in that configuration - check the resource URI is correct and present in that configuration. If the configuration is wrong (doesn't exist) I get a 404.

> Is it possible to fetch only the last change of an artifact.

Not AFAIK in the Reportable REST API.

As an alternative you could retrieve the artifact using the OSLC API - you have its URL in the reportable REST. Ensure you provide headers OSLC-Core-Version: 2.0 and Accept: application/rdf+xml - modifier is in the result in tag dcterms:contributor. The OSLC URL for the artifact is in the rrm:about tag. You'll need to add the query parameter oslc_config.context= configuration URL.

Or you use OSLC Query instead of Reportable REST because then you can request the contributor in the query results with the artifact. OSLC Query is a rather different ballgame, not sure if/how you can do OSLC Query from RPE.


Chid . commented Dec 23 '21, 10:57 a.m. | edited Dec 23 '21, 10:58 a.m.
Thank you for the detailed reply.

How to get the OSLC URL of the artifact from the response of Reportable REST.

Ian Barnard commented Dec 23 '21, 11:49 a.m.

See updated answer 

permanent link
Chid . (2052961) | answered Dec 23 '21, 4:17 a.m.

I am using RDNG iFix020 + TFR 100219v4.

This call provides the complete Audit History & the response is slow, like in UI. This xml has the "Modified By" for each change.


Is it possible to fetch only the last change of an artifact.

I tried with the revisions href also. I was not sure on how to add the config.context. Following gave a 200 response but did not have any data.

Instead of using oslc_config.context in the URI query param, I also tried oslc.configuration as a header; responded with 200; but no data in the response.

I am testing these API with REST Client.

Ian Barnard commented Dec 23 '21, 5:37 a.m.

Please use comments or update/edit your question rather than adding an "answer" which is just an extension of your question. See my updated answer. 

Your answer

Register or to post your answer.