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

[SCM]Copy Sources attached to a WI to another Project area

Hi,

Is it possible to copy sources attached to a WI to another Project Area, Eg. from development to Testing Area.

Looking for a Client Operation Code, i am successful in getting the change sets attached to a work item, im looking for a code which can copy those change sets and place it on to a Stream in another Area.

 List<IChangeSet> changeSets = new ArrayList<IChangeSet>();

ILinkManager fLinkManager = (ILinkManager) repo.getClientLibrary(ILinkManager.class);
IReferenceFactory fReferenceFactory = fLinkManager.referenceFactory();
IReference reference = fReferenceFactory.createReferenceToItem(iw.getItemHandle());
ILinkQueryPage page;
page = fLinkManager.findLinksByTarget("com.ibm.team.filesystem.workitems.change_set", reference, monitor);
ILinkCollection linkCollection = page.getLinks();
Collection<ILink> links = linkCollection.getLinksById("com.ibm.team.filesystem.workitems.change_set");
Iterator<ILink> iter = links.iterator();
while (iter.hasNext()) {
ILink link = iter.next();
IChangeSet changeSet = getChangeSet(link);
if (changeSet != null) {

changeSets.add(changeSet);
}

0 votes



3 answers

Permanent link
Just for interest's sake, why are copying the change sets and
attachments into the tester work item, rather than just creating a link
between the tester work item and the development work item?

Cheers,
Geoff

On 1/11/2012 8:23 AM, imranakbarin wrote:
Hi,

Is it possible to copy sources attached to a WI to another Project
Area, Eg. from development to Testing Area.

i am successful in getting the change sets attached to a work item, im
looking for a code which can copy those change sets and place it on to
a Stream in another Area.

List<IChangeSet> changeSets = new
ArrayList<IChangeSet>();
ILinkManager fLinkManager = (ILinkManager)
repo.getClientLibrary(ILinkManager.class);
IReferenceFactory fReferenceFactory =
fLinkManager.referenceFactory();
IReference reference =
fReferenceFactory.createReferenceToItem(iw.getItemHandle());
ILinkQueryPage page;
page =
fLinkManager.findLinksByTarget("com.ibm.team.filesystem.workitems.change_set",
reference, monitor);
ILinkCollection linkCollection = page.getLinks();
Collection<ILink> links =
linkCollection.getLinksById("com.ibm.team.filesystem.workitems.change_set");
Iterator<ILink> iter = links.iterator();
while (iter.hasNext()) {
ILink link = iter.next();
IChangeSet changeSet = getChangeSet(link);
if (changeSet != null) {

changeSets.add(changeSet);
}

0 votes


Permanent link
Hi Geoff,

I want to copy only the sources attached in a work item to a Testing Area Stream not the work item itself, a workspace and stream will be created on test area and the sources are copied to that respective stream.

Just for interest's sake, why are copying the change sets and
attachments into the tester work item, rather than just creating a link
between the tester work item and the development work item?

Cheers,
Geoff

0 votes


Permanent link
In general, you do not "copy" a change set into a stream.
You "deliver" a change set to a stream.
This is done via RTC SCM operations.
The preferred way to programatically perform RTC SCM operations is
through the RTC "scm" command line tool (see the RTC on-line
documentation for details). But sometimes you might find the need to
use the Java client library. You can download the SDK and the public
API list from the "All Downloads" page.

Cheers,
Geoff

On 1/12/2012 1:38 AM, imranakbarin wrote:
Hi Geoff,

I want to copy only the sources attached in a work item to a
Testing Area Stream not the work item itself, a workspace and stream
will be created on test area and the sources are copied to that
respective stream.

gmclemmwrote:
Just for interest's sake, why are copying the change sets and
attachments into the tester work item, rather than just creating a
link
between the tester work item and the development work item?

Cheers,
Geoff

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,950

Question asked: Jan 11 '12, 8:17 a.m.

Question was seen: 5,303 times

Last updated: Jan 11 '12, 8:17 a.m.

Confirmation Cancel Confirm