It's all about the answers!

Ask a question

How to know when a workitem was "tracked for" using OSLC or Reportable REST API?


Andre Carlos Antunes de Oliveira (4024) | asked May 03 '16, 1:27 a.m.
Is there a way to know when a workitem was "tracked for" using OSLC or Reportable REST API?
I tried the "How to get the history of a work Item by oslc?" post indications, but the answer of a OSLC query always return with oslc_cm:trackedWorkItem, no matter how stateId I used.
So, I can't know when a workitem was "tracked for".
Using Reportable REST API, seems that this is an auditableLink from itemHistory, but didn't work to me.
Sometimes a "500 internal error" response comes when i try ".../workItem/itemHistory/auditableLinks/*/*/".
I want to know when a workitem was "tracked for" e who "tracked for" a workitem.
Is it possible using OSLC or REST API (or both)?

Accepted answer


permanent link
Donald Nong (14.5k414) | answered May 05 '16, 7:06 a.m.
It's true that the attribute is auditableLink, but you got confused. It's from the "foundation" resource, not the "workitem" resource (which has attribute "itemHistory"). You can get the information using this URL:
https://clm:9443/ccm/rpt/repository/foundation?fields=foundation/auditableLink[name="com.ibm.team.workitem.linktype.trackedworkitem"]/(name|modified|modifiedBy/(userId|name)|sourceRef/(comment|referencedItem/(itemType|itemId|contextId))|targetRef/(comment|referencedItem/(itemType|itemId|contextId)))

The filter [name="com.ibm.team.workitem.linktype.trackedworkitem"] ensures that only the link type of interest is shown. The field selections are just to simplify the output for easier processing.

If you want the other direction (Tracks Work Item), the link type is "com.ibm.team.workitem.linktype.tracksworkitem". Likewise, you can find out other link types by using the appropriate link type name.

P.S. In the field selections in the above URL, "comment" of "sourceRef" and "targetRef" is the work item's ID+title, while "itemId" is the UUID of the work item, and "contextId" is the UUID of the containing project area.
Andre Carlos Antunes de Oliveira selected this answer as the correct answer

Comments
Andre Carlos Antunes de Oliveira commented May 05 '16, 11:49 p.m.

Thank you! It works!

If you can help me a bit little more, please, can you say if it's possible to know if the link was included or removed in each auditableLink entry returned by the query above?


Donald Nong commented May 06 '16, 1:08 a.m.

If you mean that you add a link, and remove it later, and you want to know when it is added and removed, then the answer is no, at least for the method suggested above. As far as I know, link history is not kept, and you can only see information about existing/current links. If you use the web GUI to check the work item history, with the Include Link History checked, you will only see "added" entries for links, and no "removed" at all.


Andre Carlos Antunes de Oliveira commented May 08 '16, 2:15 a.m.

Thank you. It helps a lot. Now, I can know if a workitem has the trackedworditem link, search the auditableLink no know who and when this link was added. If the workitem wasn't the trackedworkitem link, but the search in the auditableLink returns something, I can know when and who removed the link. All this using the RTC'S Reportable REST API.

One other answer



permanent link
Jean-Luc Johnson (8125) | answered May 03 '16, 4:17 a.m.

Hello,

I will only comment on your question. OSLC Change Management domain does not specify the way tools should manage the change history on their resources. You may be able to track the history with the OSLC Configuration management specification at OASIS.


Comments
Andre Carlos Antunes de Oliveira commented May 03 '16, 11:48 p.m.

I can't find the specification - find only a draft, and there isn't an example of use.

Can you help me a little more about this, please?


Jean-Luc Johnson commented May 05 '16, 5:35 a.m.

Hello Andre Carlos,
The OSLC CCM specification is managed at OASIS. the link is https://tools.oasis-open.org/version-control/browse/wsvn/oslc-ccm/trunk/specs/config-mgt/oslc-config-mgt.html .

This spec is still in draft version. However, IBM has implemented it in the Jazz platform. As it is a live spec, I came across few inconsistencies that are fixed in the following version of the Jazz platform.


Andre Carlos Antunes de Oliveira commented May 05 '16, 11:28 p.m.

 Thank you.

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.