It's all about the answers!

Ask a question

How to create remote change sets(with external link) ?


da zhang (311) | asked Nov 11 '13, 11:54 p.m.
retagged Dec 16 '13, 5:26 p.m. by David Lafreniere (4.4k7)
Hi,

I want to create a remote change set, like below:
After click the change set link, you can see details of change at Github:
Above is how jazzHub track changes to your Github source code.
This change set is a bit different:
1.Seems it doesn't belong to an existing component
2.It can refer to an external link , not only an existing workItem in RTC.

Now I can create change sets using following code:
IChangeSetHandle changeSet = workspace.createChangeSet (component, "comment", true, null);
IFileSystemWorkItemManager itemManager = (IFileSystemWorkItemManager) repo
                    .getClientLibrary(IFileSystemWorkItemManager.class);
List<ILink> link = itemManager.createLink(wsHandle, changeSet, 
                    new IWorkItemHandle[] { (IWorkItemHandle)workItem.getItemHandle()}, null);           

But the change sets I created must belong to an existing component, and it must to an existing workItem.

How to create remote change sets using plain java library or REST API ?

Thanks!


Comments
Lauren Hayward Schaefer commented Nov 12 '13, 7:14 a.m.
JAZZ DEVELOPER

Hi,
I have a few follow up questions for you:

  1. Can you confirm you are using JazzHub?
  2. The screenshot you included above is linking a GitHub commit to a work item in JazzHub.  This link was created automatically by using the GitHub integration with JazzHub.  I think that you are trying to create a remote change set using the plain java library or the REST API, not using the GitHub integration with JazzHub.  Is that right?
  3. Can you explain what you mean by creating a remote change set?  Where is the code stored that you are trying to create?


da zhang commented Nov 12 '13, 9:36 a.m.

Thanks for your reply!

1.No, I am using RTC.
2.Yes, I want to create a remote change set using the plain java library or the REST API in RTC.
3.I store code in Gitorious, and use RTC as issue tracker. 
I want to do the same thing like GitHub integration with JazzHub, when I excute "git commit –am "Update the hello script, per bug 1544" to Gitorious, my post-receive hook will add a link to my push to work item 1544.


Lauren Hayward Schaefer commented Nov 12 '13, 10:36 a.m.
JAZZ DEVELOPER

I'm not familiar with any Gitorious integrations.  I know that to setup the JazzHub integration with GitHub, we had to setup the Git Adapter on our server (https://jazz.net/library/article/854/).  I'm not sure if the Git Adapter would work with Gitorious.  Hopefully, someone else can point you in the right direction.

FYI @ryehle @cjkyroua


da zhang commented Nov 13 '13, 2:33 a.m.

Thanks! 

Accepted answer


permanent link
Tim Mok (6.6k38) | answered Nov 14 '13, 9:30 a.m.
JAZZ DEVELOPER
Remote change set links are created when linking a change set on one server to a work item on another server.

To create the link, use IWorkspaceManager#createLinks(). These are OSLC links and it's how distributed SCM works with work item linking. However, it is marked as experimental so be prepared if it is deprecated.
da zhang selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (56.6k23642) | answered Nov 13 '13, 3:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you are interested in the Plain Java Client Libraries, you can start your endeavor here: http://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/

The post links to several other posts around these topics. But it is only for Jazz SCM.

If you are looking for creating work items, start here: https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation

To get started on these topics, try to search here:https://rsjazz.wordpress.com/ . I have several posts around the API. This is a good starting point if you are new to it: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/

Please note, the posts are interconnected and you should be able to search the log either with the built in search or using search engines.

Comments
da zhang commented Nov 13 '13, 8:45 p.m.

Thanks!

I will keep searching and learning. 

Your answer


Register or to post your answer.