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

Programmatically retrieve team area by user Id

Hi all,
I try to retrieve team area by work item creator userId for populate a new custom field.

I will use this new information to create a simple query that show me all defects opened by team area.

I try in this way but I hope that exist other simple way:


IContributorHandle creHandle = wi.getCreator();
IContributor creator = (IContributor)(repositoryItemService.fetchItem(creHandle, null));

List<ITeamAreaHandle> teamAreas = projectArea.getTeamAreas();
for (ITeamAreaHandle taHandle:teamAreas) {
ITeamArea ta = (ITeamArea) (repositoryItemService.fetchItem(taHandle, null));

IContributorHandle[] members = ta.getMembers();
for (IContributorHandle memberHandle : members) {
IContributor member = (IContributor) (repositoryItemService.fetchItem(memberHandle, null));
if ( member.getUserId() == creator.getUserId() ) {
//TODO add this value in custom field
}
}
}


Moreover, the task have the Creator UserId value when it's just open or the creator is valorized only after a save action?

Thanks
Andrea

ps. I use RTC 2.0.0.2

1 vote


Be the first one to answer this question!

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,939

Question asked: Oct 13 '11, 10:29 a.m.

Question was seen: 5,084 times

Last updated: Oct 13 '11, 10:29 a.m.

Confirmation Cancel Confirm