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

History of workitem via OSLC for state changes

 Hello,
I need to check when an item state was changed with its timestamp.
I used the following call to retrieve the list of states changes with their modified timestamps however it returns all modified actions - I need to return only when the states were changed. How can I do that via OSLC?
https://server:port/ccm/rpt/repository/workitem?fields=workitem/workItem[id=100]/(itemHistory/(state/*%7Cmodified/*))
Thanks

0 votes

Comments

I don't know if there is filtering on this data set.

 If there is no filtering, is it possible to get the list of the previous states versus actual states with timestamp?

Thanks,


Accepted answer

Permanent link
I don't think you can see a "change" in a single history record, because only the state for that moment is recorded. You will need to compare the state with the previous history record to see if there is a "change in state". No "actions" are recorded in the history.
Note that you did not have any filtering in your original URL. That URL is requesting both the "state" and "modified" attributes of the "itemHistory" record. Using square brackets for filtering - the same way you use [id=100] for work item filtering. For example, if you want to get the history records with state "Closed" for work item #100, use URL below
https://<server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem[id=100]/(itemHistory/(state[name="Closed"]/*|modified))
To achieve what you want to do, you need to do some processing, due to the reason stated earlier. You would need this URL. You will need all the history records of the work item since you do not know which history record holds the "previous" state.
 https://<server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem[id=100]/(itemHistory/(state/*|modified|stateId|predecessor))
The key is the attributes "stateId" and "predecessor". "stateId" is the Id of the containing history record, and "predecessor" is the Id of the previous history record. Of course you can also sort the history records by the "modified" attributes so that they are in order. As stated earlier, if you compare the state with the one in the previous history record and see that they are different, you observe a "change of state".

EclipseTalk . selected this answer as the correct answer

0 votes

Comments

 Thanks Don - I'll look into it.

Thanks Donald - I'll look into it. 

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

Question asked: Jun 10 '14, 5:10 p.m.

Question was seen: 2,703 times

Last updated: Jun 17 '14, 11:45 a.m.

Confirmation Cancel Confirm