Programatically Create work items from a work item Template
Hi,
I am creating an post operation participant for project initialization which will create some work items when the project is initialized.
Question 1: Which extension point do i have to extend?
Question 2: Is it possible to create work items programatically from a work item template already defined in the project?
Awaiting a reply.
Warm Regards,
Arun
Accepted answer
Hello,
For your second question, I would say to use IWorkItemTemplateClient.
I now just let you find out what to put in the second attribute (didn't check) of instantiateTemplate method.
Please also not I didn't test the code I've wrote here. It might need some adjustment.
Regards,
Sylvain
For your second question, I would say to use IWorkItemTemplateClient.
IWorkItemTemplateClient witc = (IWorkItemTemplateClient) repo.getClientLibrary(IWorkItemTemplateClient.class); IWorkItemTemplateHandle templateHandle = witc.getTemplateHandle("Identifier", projectAreaHandle, monitor); int[] actualIDs = witc.instantiateTemplate(templateHandle, Collections . < IAttributeVariable, Object> emptyMap(), monitor);
I now just let you find out what to put in the second attribute (didn't check) of instantiateTemplate method.
Please also not I didn't test the code I've wrote here. It might need some adjustment.
Regards,
Sylvain
2 other answers
Thanks Sylvain for providing probable code to access template and create workitems as per template
Hi Arun Batra,
Have you find answer to the question you were looking for?
Even I have the same requirement in my project.Need to create work items using rtc work item templates
Request you to please post the code in case you have accomplished it
Thanks in advance!
Regards,
Harshal