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

Is it possible to programmatically create a work item in a seperate Project Area

Is it possible to programmatically create a work item via the process adviser and/or OSLC from one project area, say A, into another project area, say B.
Assumptions are that the user has proper access to both project areas and that the work item creation is trigger upon save of a 'parent' work item.
A possible scenario we have is:
Story work items have child task work items. A project manager creates a story work item that has several child tasks related to it. Project manager wants to be able to select an user (or list of users) for which tasks will be generated and linked to the story. These tasks may be in another project area.
Thanks in advance.
Derry

1

1 vote



2 answers

Permanent link
Surely you can. I solved a similar situation with OperationParticipant Java plugin ( Server Side ).

Your scenario is a little different from mine, but the workitem creation is not different i think. When the PM select user and tasks you have to link/create this tasks in other project areas.



I hope this help

1 vote

Comments

Antonio,

Can you elaborate more on this solution ? I am trying to create work item in Project B when the operation particpant of Project A is invoked. I am not sure on how to get the Project B handle from Project A. Some high level code will help

 You need to use the IAuditableServer class to obtain a reference to project area B. Example code:


String projectAreaUri = ...
String targetTypeIdentifier = ...
IAuditableServer auditableServer = getService(IAuditableServer.class);
URI uri = URI.create(projectAreaUri);
IProjectArea projectArea = (IProjectArea) auditableServer.findProcessAreaByURI(uri, null, null);
IWorkItemType targetWorkItemType = 
workItemServer.findWorkItemType((IProjectAreaHandle)projectArea.getItemHandle(), 
targetTypeIdentifier, null);
IWorkItem targetWorkItem = workItemServer.createWorkItem2(targetWorkItemType);

1 vote

Jared,

WHat is projectAreaUri - Is it name or UUID of the project B ?

WHat is the targetTypeIdentifier - Is it name or UUID of WorkItem that I want to create ?

It's the URL encoded name of your project (e.g. spaces become %20, parens become %28 and %29, etc). E.g. "My Project (Requirements)" would become something like "My%20Project%20%28Requirements%29"

1 vote


Permanent link
It is possible to Create work item programmatic in any project area. In Server side plugin, CreateWorkItemw2 method will get the type of the work item as parameter. that will decide in which area that work item should get created.

Regards
Muthukumar.C

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
× 12,019
× 10,936
× 369

Question asked: Jun 25 '12, 4:13 p.m.

Question was seen: 7,177 times

Last updated: Oct 19 '12, 12:31 p.m.

Confirmation Cancel Confirm