Fetch changeset details associated to a workitem in Ioperationparticipant
Hi,
I need to fetch the changeset details associated to a workitem. I used the workitem references approach of retrieving changeset details. I am stuck in between. Please let me know if the approach is wrong.
Please let me know if there is any better way.
My code look something like this :
IItemHandle referenceItem=null;
IWorkItemReferences workreferences = (IWorkItemReferences) workItemCommon.resolveWorkItemReferences(newState, null);
List<IEndPointDescriptor> endpoints = workreferences.getTypes();
for (IEndPointDescriptor iEndPointDescriptor : endpoints) {
List<IReference> typedReferences = workreferences.getReferences(iEndPointDescriptor);
for(IReference ref:typedReferences){
if(ref.isItemReference()){
referenceItem = ((IItemReference) ref).getReferencedItem();
System.out.println(referenceItem);
IItemType itemType = referenceItem.getItemType();
System.out.println(itemType.getName());
IChangeSet changeset=itemType.getName();
}
}
}
I need to fetch the changeset details associated to a workitem. I used the workitem references approach of retrieving changeset details. I am stuck in between. Please let me know if the approach is wrong.
Please let me know if there is any better way.
My code look something like this :
IItemHandle referenceItem=null;
IWorkItemReferences workreferences = (IWorkItemReferences) workItemCommon.resolveWorkItemReferences(newState, null);
List<IEndPointDescriptor> endpoints = workreferences.getTypes();
for (IEndPointDescriptor iEndPointDescriptor : endpoints) {
List<IReference> typedReferences = workreferences.getReferences(iEndPointDescriptor);
for(IReference ref:typedReferences){
if(ref.isItemReference()){
referenceItem = ((IItemReference) ref).getReferencedItem();
System.out.println(referenceItem);
IItemType itemType = referenceItem.getItemType();
System.out.println(itemType.getName());
IChangeSet changeset=itemType.getName();
}
}
}