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

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?

0 votes



12 answers

Permanent link
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
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?

0 votes


Permanent link
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
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?

0 votes


Permanent link
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?

0 votes


Permanent link
....
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?

0 votes


Permanent link
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

0 votes


Permanent link
Thank you very much. That helps :D

0 votes


Permanent link
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.

0 votes


Permanent link
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.

0 votes


Permanent link
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.


0 votes


Permanent link
I fetched the whole work item and I could get the category with it. Thanks :)

0 votes

1–15 items
page 1of 1 pagesof 2 pages

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
× 10,937

Question asked: Jul 02 '08, 8:12 p.m.

Question was seen: 13,404 times

Last updated: Jul 02 '08, 8:12 p.m.

Confirmation Cancel Confirm