It's all about the answers!

Ask a question

How do you open workitem if you have the ID


Charbel Abou-Khalil (1613) | asked Oct 15 '12, 4:45 p.m.
edited Oct 19 '12, 3:08 a.m. by Ralph Schoon (63.1k33645)

Hi,

I am just wondering if there is a method to open the workitem editor using the api if you have the worktiem id.

This is for RTC 3.0.

Thanks a lot.

Regards

Charbel

Accepted answer


permanent link
Charbel Abou-Khalil (1613) | answered Oct 16 '12, 2:53 a.m.
edited Oct 16 '12, 2:55 a.m.

HI , Thanks for your response, here is the code that worked for me:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkItem workItem = workItemClient.findWorkItemById(Integer.valueOf(split[i]), IWorkItem.FULL_PROFILE, null);

WorkItemUI.openEditor(page, workItem);

Regards

Charbel

Ralph Schoon selected this answer as the correct answer

2 other answers



permanent link
Ralph Schoon (63.1k33645) | answered Oct 16 '12, 12:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, you can find example code here: http://rsjazz.wordpress.com/2012/08/01/uploading-attachments-to-work-items/

permanent link
Jayesh S (1136) | answered Jul 29 '14, 9:00 a.m.

Hi,

Tried the above code to open workitemUI.but it is giving the below error

java.lang.NoClassDefFoundError: com.ibm.team.workitem.rcp.ui.WorkItemUI

 com.ibm.team.workitem.rcp.ui.jar is already there in the library


Comments
Ralph Schoon commented Jul 29 '14, 9:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

This will, as far as I understand it, only run inside an Eclipse or RCP extension. You would need to run this with the RTC SDK in an Eclipse client. In this case, you need to add the needed dependencies to the plugin.

It will not run in the plain java client libraries, because the platform is not available.

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.