Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to fetch the baseline to which changeset belongs using rtc plain java api's?

I am fetching changesets associated to the workitem. I want  to know to which baseline the changeset is associated to.

0 votes



2 answers

Permanent link

Maybe this code snippet can help you.

I wrote it with server-side java API (it is in a participant), but you can try to adapt it to plain java API.
Once you have a change set, you can check whether it is part of a given baseline using the changeSetsInBaseline method of the IScmService package.

IChangeSetHandle[] csHandleInBaseline = scmService.changeSetsInBaseline(baselineHandle, csHandle, repositoryProgressMonitorHandle);

The method returns an array of change sets that has either 0 (if the change set is not part of the baseline) ot 1 (if the change set is part of the baseline) length.
Check that this way:

int matchLength = csHandleInBaseline.length;

I have not found, so far, a method that returns the baselines of which a change set is part, so I had to retrieve a list of baselines (e.g. on a stream) and iterate over it.

1 vote


Permanent link
Hi,

please consider the RTC SCM Model as described in https://jazz.net/library/article/126
A changeset belongs to a component, but it can be part of several baselines (i.e. on different streams containing that component). You can verify by using the RTC Eclipse client and looking at context menu of a changeset - what you get offered is the Locate Change Set wizard that will you allow to see of which snapshots, baselines, work item queries etc. the change set is a part.

So you can fetch the component of a changeset. From the component you can determine the baseline list. You can query for "interesting" baselines and determine whether the change set is a part of them.

It might be easier if you could describe the underlying use case: what do you want to achieve with the information work item --> change set --> baseline?

gg,
Arne

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,955

Question asked: Apr 26 '19, 3:25 p.m.

Question was seen: 2,011 times

Last updated: May 03 '19, 5:29 a.m.

Confirmation Cancel Confirm