How to obatain TeamArea in service plugin?
How can we get the team area in the service plugin? In my service plugin I have a small method which takes in string parameters and saves it to the repository. I want to add a server-side operation and advisor, and I would need a team area object. Do I need to pass additional parameters from the client down to the service for that purpose? Can anyone give me sample code to get the team area?
|
12 answers
The question you have to answer is what defines the relationship between
the string you try to save and the team area. When the end user defines this relationship for example in an input dialog or by making a selection then you have to pass it to the server. If, for example, the value of the string (I don't think so but let's continue that thought experiment...) contains enough information to compute the team area, you don't have to pass that information to the sever explicitly. What defines the relationship in your case? Kai Jazz Process Team rkukkama wrote: How can we get the team area in the service plugin? In my service |
Jared Burns (4.5k●2●9)
| answered Jul 03 '08, 11:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi, Rakesh.
When you define a process-enabled operation, you are responsible for determining which team area is associated with that operation. How this decision is made is totally up to you. Typically, this is done by modeling some relationship between a team area and the artifacts being modified by the operation. For example, the operation which delivers change sets to a stream gets its team area by looking at the target stream and asking it for its owner. This "owner" relationship is a modeled field on the stream artifact which points to a team area. In case you haven't already found it, here's a pointer to our Developer Guide: https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide Jared Burns Jazz Process Team rkukkama wrote: How can we get the team area in the service plugin? In my service |
Thank you very much for your replies. The string that is being passed is a review component (that i am writing), which is in turn tied to a work item.
So I guess from your replies I would need to get the team area from the work item? Can you please provide code how I can do that? Is it through the Contributor who created the work item? |
....
ICategoryHandle categoryHandle = workItem.getCategory(); ICategory category = teamRepository.itemManager().fetchCompleteItem(categoryHandle, IItemManager.REFRESH, progressMonitor); List teamAreas = category.getAssociatedTeamAreas(); .... This will give you all the associated team area handles across development lines based on the work item category of the work item. HTH Darins Jazz Process Team "rkukkama" <rakesh> wrote in message news:g4jc5k$i2m$1@localhost.localdomain... Thank you very much for your replies. The string that is being passed |
Just wanted to point out an alternative approach that is a bit simpler and would match the behavior of the work item component itself (when it determines which team area is implied by a work item). More than just the category could be taken into account in determining the team area. The method IWorkItemCommon#findProcessArea has this documentation:
* Returns a handle of the process area the given work item is associated * with. This is either a team area of the work item's project area or * the work item's project area itself if no team area could be found. * * The team area is computed based on the work item's Filed Against category * and Planned For iteration. It is the team area in {@link ICategory#getAssociatedTeamAreas()} * of the same development as the Planned For iteration iff that exists, or * {@link ICategory#getDefaultTeamArea()} otherwise. So you would just call IWorkItemCommon#findProcessArea with the handle of a work item and a progress monitory. John Jazz CQ Connector Team |
|
I am getting errors accessing the CategoryHandle of a work item. It says that the category handle has not been set.
I also tried to use the IWorkItemCommon method which gives the team area but I dont know how to get an instance of that class. Is there any other way to get the team area of a work item? In the work item editor I could see the team area a work item belongs to. How can I get that particular team area. Can you please provide code. Thank you. |
IWorkItemCommon workItemCommon = (IWorkItemCommon)
repository.getClientLibrary(IWorkItemClient.class); where repository is an instanceof ITeamRepository HTH Darins Jazz Process Team "rkukkama" <rakesh> wrote in message news:g4u6eq$ih5$1@localhost.localdomain... I am getting errors accessing the CategoryHandle of a work item. It |
Not sure what the error is you see when accessing the category, but it could be that you fetched the work item without the category property. Fetching that too should fix this, please post the exact error including the stacktrace if that's not the case.
Regards, Christof Jazz Work Item team Darin Swanson wrote: IWorkItemCommon workItemCommon = (IWorkItemCommon) |
I fetched the whole work item and I could get the category with it. Thanks :)
|
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.