How to identify a Discarded Changeset programatically using Java API.
Jazzuser user (68●10●50)
| asked Oct 04 '18, 5:35 a.m.
edited Oct 09 '18, 11:45 a.m. by David Lafreniere (4.8k●7)
Hello All,
I have a scenario where i need to identify whether a given Changeset is discarded or not.
I have a Changeset Object as below.
IChangeSet changeSet = (IChangeSet) currentWIRepo.itemManager().fetchCompleteItem(changeSetHandle,
IItemManager.DEFAULT, null);
Are there any APIs to find the state of the CS, whether it is discarded or any other state.
Request you to assist on this.
Thank you.
|
2 answers
As far as I know, there isn't a public API for that, but you could use API com.ibm.team.scm.client.IWorkspaceManager#findWorkspacesContainingChangeset and test returning list if it is empty to determinate if that change-set is discarded.
Cheers.
|
Change sets on their own have no concept or property/state of being 'discarded'. You can ask the question as to whether or not a change set is 'in' (i.e. is in the change set history of a component) of a particular repository workspace or stream however.
If you need client-side API to determine this, look at:
IWorkspaceManager#findWorkspacesContainingChangeset
or if you know the workspaces or streams you care about, you might want to call:
IWorksapceManager#locateChangeSets |
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.