It's all about the answers!

Ask a question

How can I Use IWorkItemTemplateService.instantiateTemplate()


Peterson dos Santos (44139) | asked Sep 05 '19, 10:43 a.m.
Hi Friends,

I would like to know how to use the method IWorkItemTemplateService.instantiateTemplate, to create work Items  using a work item template.

templateService.instantiateTemplate(String arg0, String[] arg1, IProjectAreaHandle arg2)

What should I pass in the argument String[] arg1 ?

Thank you for helping.

One answer



permanent link
Ralph Schoon (63.5k33646) | answered Sep 18 '19, 1:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I would suggest to familiarize yourself with how to search in the RTC SDK. See https://rsjazz.wordpress.com/2019/05/16/searching-and-exploring-the-rtc-sdk/ for how to get started. Once you have set up a development environment with the RTC SDK, you can search for Java types, methods etc.


The second parameter is for parameters and values. Here an example I found:
    public int[] instantiateTemplate(final IWorkItemTemplateHandle handle, final Map<iattributevariable, object=""> variables, final Map<string, string=""> parameters, IProgressMonitor monitor) throws TeamRepositoryException {
        assertValidHandle(handle);
        Assert.isNotNull(variables);

    ServiceRunnable<int[]> runnable= new ServiceRunnable<int[]>() {
        @Override
        public int[] run() throws TeamRepositoryException {
            return getService().instantiateTemplate(handle.getId(), WorkItemTemplateSerializable.serializeVariableAndParameterValues(variables, parameters), handle.getProjectArea());
        }
    };
    return fContext.callCancelableService(runnable, monitor);
}

</int[]></int[]></string,></iattributevariable,>





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.