It's all about the answers!

Ask a question

How to identify a Discarded Changeset programatically using Java API.


Jazzuser user (681050) | asked Oct 04 '18, 5:35 a.m.
edited Oct 09 '18, 11:45 a.m. by David Lafreniere (4.8k7)
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



permanent link
SEC Servizi (97123860) | answered Oct 05 '18, 4:45 a.m.
edited Oct 05 '18, 4:46 a.m.
Are there any APIs to find the state of the CS, whether it is discarded or any other state.
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.

permanent link
David Lafreniere (4.8k7) | answered Oct 09 '18, 11:45 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
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


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.