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
2 answers
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