How to be notified about any created work item?
Accepted answer
If you want specific users to be added as subscribers to ALL workitems created in a project area, follow the instructions in this technote (no participant code required):
http://www-01.ibm.com/support/docview.wss?uid=swg21580771
http://www-01.ibm.com/support/docview.wss?uid=swg21580771
One other answer
I don't know of anything built-in to RTC, but you can do either using a server-side participant. We add subscribers(s) to a work item upon creation (of a specific type) based on a role, but you can do a single user as well. In your participant, you would do something like this:
IWorkItem workingCopy = (IWorkItem) fWorkItemServer.getAuditableCommon().resolveAuditable(workItem, IWorkItem.FULL_PROFILE, monitor).getWorkingCopy();
ISubscriptions subscriptions = workingCopy.getSubscriptions();
for (IContributorHandle subscriberHandle : subscribers) {
subscriptions.add(subscriberHandle);
}
IStatus saveStatus = fWorkItemServer.saveWorkItem2(workingCopy, null, null);
where workItem is the work item passed to the participant and subscribers is an IContributorHandle[] containing the IContributorHandle's of the people you want subscribed.
We do it by role, so that we don't have to change code when someone else needs added or someone leaves, like this:
private IContributorHandle[] findApproversByRole(IWorkItem newState, String roleName, IProgressMonitor monitor) throws TeamRepositoryException {
fWorkItemServer = getService(IWorkItemServer.class);
fAuditableCommon = getService(IAuditableCommon.class);
fProcessServerService = getService(IProcessServerService.class);
//All of this goes and gets the project area from the work item
IProcessAreaHandle processAreaHandle = fWorkItemServer.findProcessArea(newState, monitor);
IProcessArea processArea = (IProcessArea) fAuditableCommon.resolveAuditable(processAreaHandle, ItemProfile.createFullProfile(IProcessArea.ITEM_TYPE), monitor);
IProjectAreaHandle projectAreaHandle = processArea.getProjectArea();
IProcessArea projectArea = (IProcessArea) fAuditableCommon.resolveAuditable(projectAreaHandle,ItemProfile.createFullProfile(IProcessArea.ITEM_TYPE), monitor);
//Get the members of the project area and then get people with the correct role at that process area level.
IContributorHandle[] members = projectArea.getMembers();
IContributorHandle[] matchingContributors = fProcessServerService.getContributorsWithRole(members, processArea, new String[] { roleName });
return matchingContributors;
}
For emailing, you can again, do the same kind of thing in a server-side participant but instead of doing the addition of the subscribers, you can use the RTC mailService to send an email.
Susan
IWorkItem workingCopy = (IWorkItem) fWorkItemServer.getAuditableCommon().resolveAuditable(workItem, IWorkItem.FULL_PROFILE, monitor).getWorkingCopy();
ISubscriptions subscriptions = workingCopy.getSubscriptions();
for (IContributorHandle subscriberHandle : subscribers) {
subscriptions.add(subscriberHandle);
}
IStatus saveStatus = fWorkItemServer.saveWorkItem2(workingCopy, null, null);
where workItem is the work item passed to the participant and subscribers is an IContributorHandle[] containing the IContributorHandle's of the people you want subscribed.
We do it by role, so that we don't have to change code when someone else needs added or someone leaves, like this:
private IContributorHandle[] findApproversByRole(IWorkItem newState, String roleName, IProgressMonitor monitor) throws TeamRepositoryException {
fWorkItemServer = getService(IWorkItemServer.class);
fAuditableCommon = getService(IAuditableCommon.class);
fProcessServerService = getService(IProcessServerService.class);
//All of this goes and gets the project area from the work item
IProcessAreaHandle processAreaHandle = fWorkItemServer.findProcessArea(newState, monitor);
IProcessArea processArea = (IProcessArea) fAuditableCommon.resolveAuditable(processAreaHandle, ItemProfile.createFullProfile(IProcessArea.ITEM_TYPE), monitor);
IProjectAreaHandle projectAreaHandle = processArea.getProjectArea();
IProcessArea projectArea = (IProcessArea) fAuditableCommon.resolveAuditable(projectAreaHandle,ItemProfile.createFullProfile(IProcessArea.ITEM_TYPE), monitor);
//Get the members of the project area and then get people with the correct role at that process area level.
IContributorHandle[] members = projectArea.getMembers();
IContributorHandle[] matchingContributors = fProcessServerService.getContributorsWithRole(members, processArea, new String[] { roleName });
return matchingContributors;
}
For emailing, you can again, do the same kind of thing in a server-side participant but instead of doing the addition of the subscribers, you can use the RTC mailService to send an email.
Susan
Comments
Thanks for the answer, but I have access only to RTC Web UI of my Project Area - I am user and have some admin priviledges to the Project Area, but I have no access to source code/server side or stuff like this. So is there any option to have it done?
no.. there is no way to do this with just administration functions