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
I'd recommend posting a new question with a title the will get the attention of the SCM team, like "How to query for all streams for a given team area"
|
Hi,
While going through the post , i found something of my interest .In one of the post jared burns said For example, the operation which delivers change sets to a stream gets. My requirement is to know the other way round i.e to get all streams that belong to a particular team area .I could get team area information in my service plugin but couldnt find the way to get streams from ITeamArea class Please help me on this. |
I fetched the whole work item and I could get the category with it. Thanks :)
|
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) |
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 |
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. |
|
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 |
....
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 |
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? |
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.