Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How can I Use IWorkItemTemplateService.instantiateTemplate()

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.

0 votes



One answer

Permanent link

 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,>





0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Sep 05 '19, 10:43 a.m.

Question was seen: 1,354 times

Last updated: Sep 18 '19, 1:48 a.m.

Confirmation Cancel Confirm