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

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

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)?

0 votes


Accepted answer

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

0 votes

Comments

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?

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.

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

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.

0 votes

Comments

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?

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.

 Thank you.

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
× 515

Question asked: May 03 '16, 1:27 a.m.

Question was seen: 3,677 times

Last updated: May 08 '16, 2:15 a.m.

Confirmation Cancel Confirm