It's all about the answers!

Ask a question

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


Imran Akbar (56278) | asked Jan 11 '12, 8:17 a.m.
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);
}

3 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Jan 11 '12, 10:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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);
}

permanent link
Imran Akbar (56278) | answered Jan 12 '12, 1:24 a.m.
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

permanent link
Geoffrey Clemm (30.1k33035) | answered Jan 15 '12, 12:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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

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.