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

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

0 votes


Accepted answer

Permanent link
Hello,

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
Ralph Schoon selected this answer as the correct answer

1 vote


2 other answers

Permanent link
Hi Arun,
1.  https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation explains how to programmatically create work items.
2.  Great question!  I did a quick search, and I didn't find any examples.  It seems like it should be possible.  Perhaps someone else will know how to do this.

0 votes


Permanent link
 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
    
    

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

Question asked: Apr 25 '13, 8:14 a.m.

Question was seen: 4,573 times

Last updated: Apr 09 '14, 1:52 a.m.

Confirmation Cancel Confirm