基本上我想阅读工作项目的历史,以确定是否正在修改工作项目(我知道我可以使用modifiedDate来查询记录,但它没有考虑时间戳。详情How to get workitem based on modified date and time using RTC Java API)
如果有人可以共享代码以使用Java API从RTC获取历史记录以及每个历史记录的修改日期,如果可用,则会有所帮助。
答案 0 :(得分:0)
我明白了:
IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.FULL_PROFILE, monitor);
System.out.println("Last modified date: "+workItem.modified()+"\n");
IItemManager itm = teamRepository.itemManager();
List history = itm.fetchAllStateHandles((IAuditableHandle) workItem.getStateHandle(), monitor);
System.out.println("Record history details:-");
for(int i = history.size() -1; i >= 0; i--){
IAuditableHandle audit = (IAuditableHandle) history.get(i);
IWorkItem workItemPrevious = (IWorkItem) teamRepository.itemManager().fetchCompleteState(audit,null);
Date recordModifiedDate = workItemPrevious.modified();
System.out.println("Record modification date: "+recordModifiedDate);
}