It's all about the answers!

Ask a question

Get IChangeSetHandle from IChangeSet

Fabian Best (131) | asked Oct 15 '21, 4:40 a.m.
Hello everyone,

I have the latest workshop setup with EWM-SDK-Server-7.0.2 and try to develop a Java Server Side Plugin.
I'm creating a participant on the "Save Change Set Links and Comments (server)" action.
Everything is running fine but for IChangeSetHandles I get some weird behaviour.

I tried different ways to get the item handle but always get the same error.
IChangeSetHandle handle = (IChangeSetHandle) changeSet.getItemHandle();
IChangeSetHandle handle = (IChangeSetHandle) IChangeSet.ITEM_TYPE.createItemHandle(changeSet.getItemId(), changeSet.getStateId());

I would expect those to produce a IChangeSetHandle Object, but what I get is:

java.lang.ClassCastException: incompatible with

For other Handles I don't have any problems (IWorkItemHandle, IWorkSpaceHandle...)

Am I doing something wrong with retrieving the handle or is maybe something wrong with my setup?

Thanks in advance.

Accepted answer

permanent link
Ralph Schoon (63.1k33646) | answered Oct 15 '21, 7:41 a.m.
edited Oct 15 '21, 7:42 a.m.

You should consider checking your imports. You likely want


It is good to carefully read the error messages, that is often the first step to a solution. I am aware that sometimes you just don't spot it.

If you set up your development environment with the SDK, you can actually open the classes. Then you can see that information below. If you want to know more about how to get there, let me know. 

  @see IAuditable
  @since 0.5
  @NoImplement This interface is not intended to be implemented by clients.
public interface IChangeSet extends IChangeSetHandle, IAuditable {

So you can simply cast to the handle.

Fabian Best selected this answer as the correct answer

Fabian Best commented Oct 15 '21, 7:48 a.m.
I had "" in the imports.
Replacing that with "" worked for me.
Thanks a lot!

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.