It's all about the answers!

Ask a question

How to obatain TeamArea in service plugin?


Rakesh Kukkamalla (5615) | asked Jul 02 '08, 8:12 p.m.
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



permanent link
Ryan Manwiller (1.3k1) | answered Jun 19 '09, 11:12 a.m.
JAZZ DEVELOPER
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"

permanent link
megha mittal (15112615) | answered Jun 19 '09, 8:33 a.m.
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
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.
.
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.

permanent link
Rakesh Kukkamalla (5615) | answered Jul 08 '08, 2:39 p.m.
I fetched the whole work item and I could get the category with it. Thanks :)

permanent link
Christof Marti (681) | answered Jul 08 '08, 3:32 a.m.
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)
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
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.



permanent link
Darin Swanson (3161) | answered Jul 07 '08, 6:51 p.m.
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
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.

permanent link
Rakesh Kukkamalla (5615) | answered Jul 07 '08, 6:45 p.m.
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.

permanent link
Rakesh Kukkamalla (5615) | answered Jul 03 '08, 8:01 p.m.
Thank you very much. That helps :D

permanent link
John Vasta (2.6k15) | answered Jul 03 '08, 6:19 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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

permanent link
Darin Swanson (3161) | answered Jul 03 '08, 4:36 p.m.
....
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
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?

permanent link
Rakesh Kukkamalla (5615) | answered Jul 03 '08, 4:15 p.m.
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


Register or 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.