How to fetch component and stream name from a changeset associated to a workitem
Chandan M B (113●1●41●84)
| asked Jun 29 '15, 7:55 a.m.
edited Jul 03 '15, 1:23 a.m. by Ralph Schoon (63.6k●3●36●47)
Hi,
I need to fetch component name and stream name for a change set associated to a workitem in the follow up action/server side extensions. Any idea... ? |
5 answers
Ralph Schoon (63.6k●3●36●47)
| answered Jun 29 '15, 8:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If this is a SCM delivery participant, you can probably get at the data. Start here: https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/
It is an advisor, but except that it implements the advisor, all the other code is relevant. That at least gives you the right entry point into the SCM API. I don't have more example code. You can find some other code using the SCM API on https://rsjazz.wordpress.com/ and there is also some code on http://thescmlounge.blogspot.de/ but probably not exactly what you are looking for. Comments Hi,
Ralph Schoon
commented Jun 29 '15, 8:37 a.m.
| edited Jun 29 '15, 8:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you add a JAR file of the common API to your plugin, you are doing it wrong. The Plugin only declares the dependencies. Follow the Rational Team Concert Extensions Workshop and note that there is no Jar added to the classpath.
Chandan M B
commented Jun 29 '15, 8:41 a.m.
I corrected it. Added it to dependencies. Please have a look at my code above.
Ralph Schoon
commented Jun 29 '15, 9:02 a.m.
| edited Jun 29 '15, 9:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There is no code up there. that is a declaration in the plugin.xml. It can only harm the execution of your code if
I would really suggest you start providing useful information about the errors you see in your future questions, because it is just only costing time to try squeezing useful information out of them and I don't have the time to do that any more.
Chandan M B
commented Jun 29 '15, 9:59 a.m.
I am doing something like this
|
Object data1 = operation.getOperationData();
DeliverOperationData deliverydata = (DeliverOperationData) data1; I have used the above given code snippet, but facing the below given exception. Please suggest. java.lang.ClassCastException: com.ibm.team.workitem.common.internal.SaveParameter incompatible with com.ibm.team.scm.common.process.DeliverOperationData Comments
Ralph Schoon
commented Jun 29 '15, 10:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If this question is not related to the one above, please create your own question.
Ralph Schoon
commented Jun 29 '15, 10:26 a.m.
| edited Jun 29 '15, 10:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you don't know what a ClassCast Exception is and how the extension mechanisms work and how you can debug them, start here:
Rational Team Concert Extensions Workshop
This is what Google tells you about the exception: http://docs.oracle.com/javase/7/docs/api/java/lang/ClassCastException.html Use the debugger and the information below to understand what the data1 object is and how you can use it. https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ shows SCM related operations. Use the debugger to find out what your class really is and the examples above what you should do with it. |
How to fetch DeliverOperationData reference inside AbstractService class. Can you please tell me if is there any way to fetch this DeliverOperationData in my user defined class.
Comments
Ralph Schoon
commented Jun 30 '15, 4:24 a.m.
| edited Jun 30 '15, 4:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There are many examples available. Including the other links in my answers above. Here are more:
Chandan M B
commented Jun 30 '15, 4:48 a.m.
Thanks for the information above.
|
The ClassCastException thrown to indicate that your code has attempted to cast an object to a subclass of which it is not an instance. Casting only works when the casted object follows an is a relationship to the type you are trying to cast to.
When will be ClassCastException is thrown:
|
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.