It's all about the answers!

Ask a question

Creating work items with plain java


Laurence Caraccio (9166) | asked Aug 24 '11, 6:13 a.m.
I'm using plain java and I've got as far as making work items in a jazz project, currently though I can't figure out how to set the owner of a work item.
I get that your meant to use workItem.setOwner(fOwner); where fOwner is of the type IContributorHandle. I think what I need to do is get a list of users from the server and select it from that but I've no idea how.

Any help with this would be greatly appreciated.

2 answers



permanent link
Ralph Schoon (57.7k23642) | answered Aug 24 '11, 9:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I'm using plain java and I've got as far as making work items in a jazz project, currently though I can't figure out how to set the owner of a work item.
I get that your meant to use workItem.setOwner(fOwner); where fOwner is of the type IContributorHandle. I think what I need to do is get a list of users from the server and select it from that but I've no idea how.

Any help with this would be greatly appreciated.


Laurence, the Extending Team Concert Forum discusses these things.

You can resolve a handle using auditableClient.resolveAuditable(). You can get a contributor by ID and other means.



IAuditableClient auditableClient = (IAuditableClient) teamRepository
.getClientLibrary(IAuditableClient.class);

IContributor aUser = (IContributor ) auditableClient.resolveAuditable(handle,...)

IContributor idUser = teamRepository.contributorManager().fetchContributorByUserId(fContributorUserID, null);


permanent link
Laurence Caraccio (9166) | answered Aug 24 '11, 10:38 a.m.
Laurence, the Extending Team Concert Forum discusses these things.

You can resolve a handle using auditableClient.resolveAuditable(). You can get a contributor by ID and other means.



IAuditableClient auditableClient = (IAuditableClient) teamRepository
.getClientLibrary(IAuditableClient.class);

IContributor aUser = (IContributor ) auditableClient.resolveAuditable(handle,...)

IContributor idUser = teamRepository.contributorManager().fetchContributorByUserId(fContributorUserID, null);



Cheers for your help, the way I found to do it was get all the users off the server using: IContributorHandle[] contributors = projectArea.getMembers();

then convert each one to a IContributor via ITeamRepository and get the item back, you can then get the details from the item

Your answer


Register or to post your answer.