rtcjazzibm-jazz

How to get ChangeSet(All files changes) from IWorkItem item by Program


How to get ChangeSet(All files changes) from IWorkItem item by Program.

I want a list contains all the files that got change for a RTC. how can I achieve this?


Solution

  • You can see if this thread helps: (from the client side)

    Code:

    IClientLibraryContext ctx = (IClientLibraryContext)repository;
    IQueryService svc = (IQueryService)ctx.getServiceInterface(IQueryService.class);
    AuditableLinkQueryModel alqr = AuditableLinkQueryModel.ROOT;
    IItemQuery iq = IItemQuery.FACTORY.newInstance(alqr);
    
    iq.filter(alqr.name()._eq("com.ibm.team.filesystem.workitems.change_set").
      _and( alqr.targetRef().referencedItem().itemId()._eq(iq.newUUIDArg())));
    
    IItemQueryPage itemQueryPage = svc.queryItems(
      iq,
      new Object[] { workItem.getItemId() }, 
      IQueryService.ITEM_QUERY_MAX_PAGE_SIZE);
    
    List<IChangeSet> items = mgr.fetchCompleteItems(itemQueryPage.getItemHandles(), 
                                        mgr.DEFAULT, null);
    Set<String> changedFilesAndFolders = new TreeSet<String>();
    for (IChangeSet cs: changeSets) {
       ...
    }
    

    You would still need to list files within each change set of items.

    you have some idea to list files in:

    Other sources: