This page lists recipient generator scripts to be used in conjunction with notification schemes. These scripts were taken straight from the public JIRA site. Please note that some scripts may be snippets and probably WILL need modification to work properly for your situation. Treat these as templates that you can modify from.
You could have repository users that are close to Anthill user names and their is a easy operation to map the two and it is painful to add repository aliases for every user.
Script Notes:
import com.urbancode.anthill3.domain.security.*; org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("Committer Notification"); userSet = new java.util.HashSet(); changelogs = ChangeLogHelper.getChangeLogArray(workflow); repoId = workflow.getBuildLife().getProfile().getSourceConfig().getRepository().getId(); for (int i = 0; i < changelogs.length; i++){ changesets = changelogs[i].getChangeSetArray(); for (int j = 0; j < changesets.length; j++){ username = changesets[j].getUser(); // remove the domain name from the repo user name username = username.substring(username.indexOf("\\") + 1); tempUsers = UserFactory.getInstance().restoreAllForChangelogNameAndRepository(username, repoId); if (tempUsers.length == 0) { log.warn("Did not find a user matching developer name '" + username + "'"); } com.urbancode.commons.util.CollectionUtil.addAll(userSet, tempUsers); } } result = new User[userSet.size()]; userSet.toArray(result); activeUsers = new java.util.ArrayList(); for ( int i = 0; i < result.length; i++ ) { if ( !result[i].isDeleted() && !result[i].isInactive()) { activeUsers.add(result[i]); } } return (User[]) activeUsers.toArray(new User[activeUsers.size()]);
import com.urbancode.anthill3.domain.buildrequest.RequestSourceEnum; import com.urbancode.anthill3.domain.security.User; if (RequestSourceEnum.MANUAL.equals(request.getRequestSource())) { return new User[] { request.getRequester() }; } return null;
NOTE: The e-mails returned must match a User in the Anthill authentication realm!
if (workflow.getProject().hasProperty("project.managers")) { return UserLookup.getUsersForNames(workflow.getProject().getProperty("project.managers").getValue().split(",")); }