如何使用 RTC Java API 获取工作项的历史数据

How to get History data of workitem using RTC Java API

基本上我想阅读工作项的历史记录以确定工作项是否正在被修改(我知道我可以使用 modifiedDate 来查询记录但它不考虑时间戳。详细信息How to get workitem based on modified date and time using RTC Java API

如果有人可以共享代码以使用 Java API 从 RTC 获取历史记录以及每个历史记录的修改日期,历史记录 ID(如果可用),这将很有帮助。

我知道了:

    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);
    }