It's all about the answers!

Ask a question

How to get an IConfiguration from IChangeSet?


Ernest Crvich (19211919) | asked Jan 31 '11, 10:07 p.m.
I have an IChangeSet retrieved from an IWorkItem. I can get the IFileItem from this without a problem. However, in order to get the full path to the file, I need an IConfiguration object so I can use locateAncestors() or determineAncestorsInHistory().

Presumably this would come from the IWorkspace (or rather the IWorkspaceConnection for that workspace) that the IChangeSet is associated with.

So I guess the real question might be...how do I obtain the workspace associated with a changeset?

11 answers



permanent link
John Camelon (1.7k14) | answered Feb 02 '11, 9:44 p.m.
JAZZ DEVELOPER
We do not make it easy for you to find a workspace which references this change set, at least by using API. There are ways to do it under the covers, but it has not been exposed as API as of yet. I have raised a work item at https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/152190 to track this.

There is a hint that is often useful (but not necessarily always correct), hidden in the ILink which serves as the binding between the IChangeSetHandle (source) and the IWorkItemHandle (target).
The IItemReference for the source side has a String extraInfo field which can be retrieved via IItemReference#getExtraInfo(). This string will be of the format IWorkspace=<UUID> which indicates the originating workspace. You can create a handle to the IWorkspace by using IWorkspace.ITEM_TYPE.createItemHandle(suppliedUUID, null).

This workspace many have moved on and discarded this change set from its history. Additionally, the workspace may have been deleted after the link was created. But often this "hint" is good enough for interpretting the change set with respect to paths.

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.