RTC approval
hi me name is kim.
I'm styding server -side of RTC API
i know create approval through contributor-id but
i'd like to find contributor-id through contributor-name
and then i'd like to create approval through contributor-id
i can't find contributorManager of server-side...
this is my client approval source.
String user = "KIM";
IContributorHandle contributorHandle = null;
IContributorManager ctm = repo.contributorManager();
List<IContributor> contributors = ctm.fetchAllContributors(monitor);
for (IContributor contributor : contributors) {
if (contributor.getName().equals(user)) {
contributorHandle = (IContributorHandle) contributor
.getItemHandle();
}
}
IApprovals approvals = workItem.getApprovals();
IApprovalDescriptor descriptor = approvals.createDescriptor(
WorkItemApprovals.APPROVAL_TYPE.getIdentifier(),"comment");
IApproval approval = approvals.createApproval(descriptor,contributorHandle);
approvals.add(approval);
|
One answer
Ralph Schoon (63.6k●3●36●46)
| answered Nov 27 '12, 2:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Nov 27 '12, 2:09 a.m.
Kim, the Server side API looks like this:
IContributorService contributorService = getService(IContributorService.class); IContributorHandle approver = contributorService.fetchContributorByUserId(getApproverFromOwner(newState.getOwner())); There seems to be no fetch for all contributors. You would have to get the project area and the team areas or another service to get all contributors. You can use the Eclipse Plugin Development environment to search the SDK for information such as contributor handles returned by a call. |
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.