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

How can I get the defect owner name?

What I want to do is executing a query and get some defects and get their bug owner names and user ids (E-mail address). Now I can make the query work and get a IQueryResult object and iterate it and get IResolvedResult object, then I call the getOwner method to get a IContributorHandle object. How should I go forward to get a IContributor object and retrieve the contributor's attributes(including user name, user id and others)?

I cannot find Javadoc for the Java client library, so I don't what I should do to get this done, please help, thanks.

0 votes



4 answers

Permanent link
You can get the IContributor by using the IItemManager's fetchCompleteItem method. You get the IItemManager from the ITeamRepository, eg:

ITeamRepository repository = login(monitor); // login actually connects, etc.

IItemManager itemManager = repository.itemManager();
// Use your query to get an IContributorHandler contribHandle
IContributor contrib = (IContributor) itemManager.fetchCompleteItem(contribHandle, IItemManager.DEFAULT, monitor);


Once you've got the IContributor, you can just use the getName() and getEmailAddress() methods to get the attributes you're looking for.

0 votes


Permanent link
Thanks. How about the defect severity and priority? The method getSeverity() and getPriority() of IWorkItem returns Identifier object. And from this object, I only can get the select option value like 'literal.0' using the method getStringIdentifier(). How can I get its corresponding display text like 'Sev3'?

0 votes


Permanent link
Hi
For the enumeration, use the IWorkItemClient library . The method 'resolveEnumeration' will give you an IEnumeration where you can use the findEnumerationLiteral method with the identifier from the work item to retrieve the ILiteral. ILiteral has a getName method.

Regards

Marcel
Jazz Work Item team

0 votes


Permanent link
Hi
For the enumeration, use the IWorkItemClient library . The method 'resolveEnumeration' will give you an IEnumeration where you can use the findEnumerationLiteral method with the identifier from the work item to retrieve the ILiteral. ILiteral has a getName method.

Regards

Marcel
Jazz Work Item team


Thank you very much for your help!

0 votes

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: Apr 22 '09, 4:32 a.m.

Question was seen: 6,528 times

Last updated: Apr 22 '09, 4:32 a.m.

Confirmation Cancel Confirm