Can we programmatically create work item/s using work item templates in RTC?
![]()
RTC SDK APIs provide automation in creating and updating work items. RTC also supports work item templates to create work item/s using UI based on template configured in RTC. Is there support for creating work item/s based on work item templates using RTC SDK APIs? If yes, then can someone please provide a head start?
Thanks. |
2 answers
![]()
Thanks Ralph for help and Rahul for asking question!
I found this code working to create workitems using templates. Method call "instantiateTemplate" basically creates WI using process templates IWorkItemTemplateClient witc = (IWorkItemTemplateClient) repository.getClientLibrary(IWorkItemTemplateClient.class); String projectAreaName = "Project name; IProcessClientService processClient = (IProcessClientService) repository .getClientLibrary(IProcessClientService.class); URI uri = URI.create(projectAreaName .replaceAll(" ", "%20")); IProjectArea projectAreaHandle = (IProjectArea) processClient.findProcessArea(uri, null, null); System.out.println(projectAreaHandle.getName()); List<IWorkItemTemplateHandle> templateHandles = witc.getTemplateHandles(projectAreaHandle, monitor); for(IWorkItemTemplateHandle templateHandle : templateHandles){ if(templateHandle.getName().equals("Epic Template")){ System.out.println("Name===="+templateHandle.getName()); Map<IAttributeVariable, Object> map = new HashMap<IAttributeVariable, Object>(); int[] count = witc.instantiateTemplate(templateHandle, map, monitor); } } |
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Mar 24 '14, 4:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Rabul,
looking at the Eclipse client you can see where this is done in the Client SDK: ![]() If you go into the code, you can see this code: ![]() I am not sure if IWorkItemTemplateClient is in the plain JavaClient Libraries, but it is the class that is used in the RTC Eclipse client. Comments Just checked and the JavaDoc ofthe Plain Java Client Libraries shows IWorkItemTemplateClient being available.
|
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.