How to link workItem in one project area to workitem in other project area using participant plugin
Hello,
I am quite new in plugin development for RTC. I am writing a Participant plugin. My requirment :
1. Creating a new workItem(Implementation task-customize) in Project Area B from a workItem (Defect) in Project Area A,
2. link created new work Item ,from Step 1, in project area B as a child to workItem in project Area A.
I've completed 1st part , and need some help or code snipped for part 2 (create parent child WorkItem link in Project Area A and B)
Please guide me to the correct information if already available. I already check https://jazz.net/wiki/bin/view/Main/ProgrammaticLinkCreation link but couldnt understand as ILinkManager is not available.
|
Accepted answer
Ralph Schoon (63.3k●3●36●46)
| answered Nov 30 '12, 9:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can find some information in the link API here: http://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/
I haven't tried that yet, but IWorkItemServer provides a way to create a work item in the server API. You probably need to work with the WorkingCopy as described here http://rsjazz.wordpress.com/2012/11/27/resolve-parent-if-all-children-are-resolved-participant/ and here http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ . Nikhil Bharti selected this answer as the correct answer
Comments
Nikhil Bharti
commented Nov 30 '12, 10:29 a.m.
Thank you Ralph thats what I am looking for.
I've another requirement. I've created 'Implementation Task' (WorkItem) on project area B, I was able to copy the value of attributes Summary and Description from workItem in Project A , using wi.setHTMLSummary and description method , however , I've requirement to set the mandatory attributes 'Filed Against' (type category) and 'Owned By'(type contributor) attributes. I tried finding these attributes using workItemServer.findAttributes method using ID but couldn't get any success.
Appreciate if I get some sample code to set 'Filed Against' and 'Owned By' value to the new workItem in project area B.
|
2 other answers
Ralph Schoon (63.3k●3●36●46)
| answered Nov 30 '12, 11:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Nikhil,
this is how the code for creating and linking a work item would look like. How you would find the owner would depend on your scenario and can get quite complex. I am about to blog about a participant to create an approval but won't be able to make it next week. The code below is the simple scenario where you know the owner ID. private IWorkItem createWorkItem(String projectAreaName, String workItemType, String categoryName, String summary, String owner, IProgressMonitor monitor) throws TeamRepositoryException { URI uri = URI.create(projectAreaName.replaceAll(" ", "%20")); IProcessArea processArea = fAuditableCommon.findProcessAreaByURI(uri, null, monitor); IProjectAreaHandle projectArea=processArea.getProjectArea(); IWorkItemType type = fWorkItemCommon.findWorkItemType(projectArea, workItemType, monitor); List Comments
Ralph Schoon
commented Nov 30 '12, 11:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
And this code calls it
fAuditableCommon = getService(IAuditableCommon.class); fWorkItemCommon = getService(IWorkItemCommon.class);
Nikhil Bharti
commented Dec 03 '12, 5:06 a.m.
Thank you Ralph. Much appreciated |
Ralph Schoon (63.3k●3●36●46)
| answered Nov 30 '12, 12:59 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Decided to get the approval participant posted right away. Maybe an inspiration for you how to find the owner for the work item.
|
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.