It's all about the answers!

Ask a question

Can I use RTC CLI to associate a change set to a workitem in another repository?


Chong Yuan Yin (7612) | asked Apr 21 '15, 3:16 a.m.
JAZZ DEVELOPER
edited Apr 21 '15, 3:19 a.m.
Using RTC client, I'm able to associate a change set to a different repository using "Associate Change Request". Can I do the similar thing using command line? I read the help but it seems it only talks about the workitem in the same repository.

Could anyone give a hint? Thanks!

6 answers



permanent link
Shashikant Padur (4.2k27) | answered Apr 21 '15, 4:14 a.m.
JAZZ DEVELOPER
edited Apr 21 '15, 4:17 a.m.
Yes, depending on which version of the scm cli client it should be either 'scm changeset associate <changeset uuid/alias> <workitem>@<repoNickname_or_repoUrl>' or 'scm add workitem <changeset uuid/alias> <workitem>@<repoNickname_or_repoUrl>'
I believe you should login into the repository using the scm cli prior to issuing that command.

permanent link
Chong Yuan Yin (7612) | answered Apr 28 '15, 11:26 p.m.
JAZZ DEVELOPER
edited Apr 28 '15, 11:38 p.m.
Thanks Shashikant for your help. But I encountered another issue when using this syntax.

For example, I have 2 repositories, repA is the SCM repository and repB stores the workitems. I was using 'scm add workitem <changesetUUID>@repA <workitemID>@repB', my RTC client is 4.0.6. Then there reports the following error:

'Problem running 'add workitem':
Service failed to communicate with repository repA: CRJAZ0105E The request for the following URL was denied: /ccm/service/com.ibm.team.scm.common.IScmService.  The status is "Unauthorized".'

I have logged into both repositories before the add workitem command. I also have tried to support login info in the add workitem command (-u <userid> -P <password>), but it didn't work either. Anything I missed here? Thank you!

Comments
Shashikant Padur commented Apr 29 '15, 5:16 a.m.
JAZZ DEVELOPER

It is taking the repository name as 'repA' which seems incorrect. When you logged in using the cli did you specify a nick name?

For ex: scm login -r https://your_repo_url -u user_name -P password -n nick_name
If so, can you run 'scm list credentials' and see if the nickname is listed against the repo url.


permanent link
Chong Yuan Yin (7612) | answered Apr 29 '15, 5:31 a.m.
JAZZ DEVELOPER
Oh, 'repA' and 'repB' was confusing.. To make things clear, I just used 'repA' and 'repB' here to represent the repo url so it's shorter. In my real case, I used the full repo url after @, but it didn't work and reported error

Comments
Shashikant Padur commented Apr 30 '15, 12:18 a.m.
JAZZ DEVELOPER

I am assuming you are able to run other commands which execute successfully. Could you try to list the change sets of the workitem. The command to run is : scm list changesets -W workitemId -r repoUrl_or_nickName.


permanent link
Chong Yuan Yin (7612) | answered May 03 '15, 10:36 p.m.
JAZZ DEVELOPER
There is no error/exception if I execute 'scm list changesets', but it always reports 'No change sets found for the specified workitems' (As I suggested early, the workitems and the changesets are in different repositories, I'm not sure if this result is as expected?)

I also found that when executing 'scm add workitem', it occasionally throws exceptions like:
java.lang.NullPointerException
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.getBundle(RegistryStrategyOSGI.java:150)
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:166)
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry$Descriptor$1.run(ClientLibraryFactoryRegistry.java:140)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry$Descriptor.getFactory(ClientLibraryFactoryRegistry.java:132)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry.getClientLibrary(ClientLibraryFactoryRegistry.java:89)
        at com.ibm.team.repository.client.internal.TeamRepository.getClientLibrary(TeamRepository.java:527)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.getPreviewManager(ResourceReferenceResolver.java:199)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolveWithResourcePreview(ResourceReferenceResolver.java:271)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolveWithRepositoryItems(ResourceReferenceResolver.java:258)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolve(ResourceReferenceResolver.java:162)
        at com.ibm.team.filesystem.client.internal.calm.OslcLinkUtil.fetchDetails(OslcLinkUtil.java:358)
        at com.ibm.team.filesystem.rcp.core.internal.oslc.OslcLinkWrapper.fetchDetails(OslcLinkWrapper.java:299)
        at com.ibm.team.filesystem.rcp.core.internal.changes.util.listeners.UpdateChangesJob.run(UpdateChangesJob.java:482)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
java.lang.NullPointerException
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.getBundle(RegistryStrategyOSGI.java:150)
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:166)
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry$Descriptor$1.run(ClientLibraryFactoryRegistry.java:140)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry$Descriptor.getFactory(ClientLibraryFactoryRegistry.java:132)
        at com.ibm.team.repository.client.internal.ClientLibraryFactoryRegistry.getClientLibrary(ClientLibraryFactoryRegistry.java:89)
        at com.ibm.team.repository.client.internal.TeamRepository.getClientLibrary(TeamRepository.java:527)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.getPreviewManager(ResourceReferenceResolver.java:199)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolveWithResourcePreview(ResourceReferenceResolver.java:271)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolveWithRepositoryItems(ResourceReferenceResolver.java:258)
        at com.ibm.team.calm.foundation.client.preview.ResourceReferenceResolver.resolve(ResourceReferenceResolver.java:162)
        at com.ibm.team.filesystem.client.internal.calm.OslcLinkUtil.fetchDetails(OslcLinkUtil.java:358)
        at com.ibm.team.filesystem.rcp.core.internal.oslc.OslcLinkWrapper.fetchDetails(OslcLinkWrapper.java:299)
        at com.ibm.team.filesystem.rcp.core.internal.changes.util.listeners.UpdateChangesJob.run(UpdateChangesJob.java:482)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Problem running 'add workitem':
Service failed to communicate with repository https://xxxxxx:9443/ccm/: CRJAZ0105E The request for the following URL was denied: /ccm/service/com.ibm.team.scm.common.IScmService.  The status is "Unauthorized".

permanent link
Shashikant Padur (4.2k27) | answered May 03 '15, 11:10 p.m.
JAZZ DEVELOPER
Please raise a defect and these details to it. Thanks.

permanent link
Chong Yuan Yin (7612) | answered May 03 '15, 11:53 p.m.
JAZZ DEVELOPER
Created defect https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/355689

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.