It's all about the answers!

Ask a question

How to get Project Area Name on Source Control?


JaeSung Yang (21145) | asked Jun 15 '11, 3:23 a.m.
Hi.

I want to know how to get Project Area Name on source control.

so, i searched repository workspace, stream, user, changeset for Project Area Name

but, i didn't find (repository workspace, stream, user, changeset).

"String projectName = operation.getProcessArea().getName();"

this code get stream's owner value.

but if stream's owner is team area, i can't get project area name.

How do you get Project Area Name on source control?

thanks.

3 answers



permanent link
Nick Edgar (6.5k711) | answered Jun 17 '11, 11:42 a.m.
JAZZ DEVELOPER
If you have the stream, use:

IWorkspace stream = ...
IProcessAreaHandle processAreaHandle = stream.getOwner();
IProcessArea processArea = /* fetch processAreaHandle */
IProjectAreaHandle projectAreaHandle = processArea.getProjectArea();
IProjectArea projectArea = /* fetch projectAreaHandle */
String name = projectArea.getName();


On the client side, you'd use IItemManager to fetch the items, on the server side you'd use IRepositoryItemService.

permanent link
Nick Edgar (6.5k711) | answered Jun 17 '11, 11:47 a.m.
JAZZ DEVELOPER
The tree structure that Geoff mentions is maintained at project area level (not as parent/children links in each team area). You can get at the info using:

IProjectArea projectArea = /* see above */
ITeamAreaHierarchy hierarchy = projectArea.getTeamAreaHierarchy();
ITeamAreaHandle teamArea = /* handle for some team area */
ITeamAreaHandle parent = hiearchy.getParent(teamArea); // null means project is parent
Set children = hierarchy.getChildren(teamArea); // set of ITeamAreaHandle

permanent link
Geoffrey Clemm (30.1k33035) | answered Jun 15 '11, 9:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I don't know the API details, but team areas are arranged in a tree, the
root of which is a project area. So you'll want to look for some kind
of a "parent" relation from a team area (and keep traversing it until
you reach the project area), or a team area might have a direct pointer
to the root of the hierarchy (i.e. the project area).

Cheers,
Geoff

On 6/15/2011 3:38 AM, jjangrang wrote:
Hi.

I want to know how to get Project Area Name on source control.

so, i searched repository workspace, stream, user, changeset for
Project Area Name

but, i didn't find (repository workspace, stream, user, changeset).

"String projectName =
operation.getProcessArea().getName();"

this code get stream's owner value.

but if stream's owner is team area, i can't get project area name.

How do you get Project Area Name on source control?

thanks.

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.