It's all about the answers!

Ask a question

Is it possible in RTC to get the history of an wotrkitem with all the attributes changed that are recorded in history via REST?


Yogesh Ranjitkar (154) | asked Jan 17 '22, 8:59 p.m.
edited Jan 18 '22, 2:49 a.m. by Ralph Schoon (63.5k33646)

 I am trying to get use a REST API to get the history of an workitem with all the attributes that are recorded as changed in the hostory. I am using "https://server/ccm/rpt/repository/workitem?size=10&fields=workitem/workItem[id=123]/(itemHistory/*)" to do so but I am not getting all the attributes. It only gives me datemodified, descriptiona an summary. But what I am after is to get any changes recorded. Is there possiblility to do that via REST in RTC?

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Jan 18 '22, 2:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jan 18 '22, 2:45 a.m.

 First of all, EWM has many APIs. The API you use above is referred to as reportable REST API.


This is the only public REST APIs that allow access to the history off a work item that I am aware of. 


To get the history:

  • itemHistory (type: com.ibm.team.workitem.WorkItem, maxOccurs: unbounded). A collection of zero or more WorkItem elements, representing the entire history of the work item. Each state the work item has ever been in is reflected in this history list.

The correct syntax is 


That returns all work item states with all the attributes that are set.


Comments
Ralph Schoon commented Jan 18 '22, 2:46 a.m. | edited Jan 18 '22, 2:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I edited the answer providing the correct syntax. The correction would not work in  a comment for whatever reason. 


Use (itemHistory/(*))


permanent link
Yogesh Ranjitkar (154) | answered Jan 18 '22, 7:49 p.m.

Hi Ralph Schoon 

Thanks for the reply. I tried the api you suggested but still I am not getting all the attribute. Moreover, I can see the xml response with lots of 
<category/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>
<customAttributes/>

and no display value for them. Is that because this fields could be custom field and not out of box field


Comments
Ralph Schoon commented Jan 19 '22, 2:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No value means that there is no value set. 


"not getting all the attribute" - if you are interested in help here on the forum, provide details

I have answered what I can. If I wanted to know more, especially custom attributes, I would make sure I understand what values the work item actually has and try to set all attributes and then check what the reportable REST API provides.

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.