This page last changed on May 15, 2007 by jeff.

In JIRA 3.6, it is now possible to programmatically determine which assignee to set if the user chooses "Automatic". Previously it was always the project/component lead or "unassigned".

To do this, make your own implementation of the AssigneeResolver interface, and package it as a component plugin. For example, here is a simple implementation that makes Bugs unassigned:

package com.atlassian.jira.plugin.ext;

import com.atlassian.jira.plugin.assignee.impl.DefaultAssigneeResolver;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.project.ProjectManager;
import com.atlassian.jira.security.JiraAuthenticationContext;
import com.opensymphony.user.User;

import java.util.Map;

/**
 * Leaves bugs unassigned by default; everything else follows the normal JIRA rules.
 */
public class CustomAssigneeResolver extends DefaultAssigneeResolver
{
    public CustomAssigneeResolver(ProjectManager projectManager, JiraAuthenticationContext authenticationContext)
    {
        super(projectManager, authenticationContext);
    }

    public User getDefaultAssignee(Issue issue, Map fieldValuesHolder)
    {
        if (issue.getIssueTypeObject().getId().equals("1")) // 1 is the id for the Bug issue type.
        {
            return null; // unassigned
        }
        else return super.getDefaultAssignee(issue, fieldValuesHolder);
    }
}

See the attached plugin source which packages this, and can be used as a starting point for your own customizations.


Document generated by Confluence on Oct 06, 2009 00:31