Default Assignee
Use a Groovy script to suggest assignees when an issue is opened. These are alternative defaults: select the script appropriate to your workflow.
The default Assignees field is a User field with Allow Multiple enabled. Return a list of user login names, or an empty list for no assignee. Default values do not grant users access to the project.
Assign to directly configured project owners
In Administration > Groovy Scripts, add a script named project-owners:
import io.onedev.server.model.Project
def project = Project.get()
def owners = project.userAuthorizations.findAll { it.role.owner }*.user.name
owners += project.groupAuthorizations.findAll { it.role.owner }*.group.members.flatten()*.name
return owners.unique()
This reads owner roles assigned directly to the project, including members of directly authorized owner groups. It does not enumerate administrators or ownership inherited from parent projects.
Open Administration > Issue Settings > Fields > Assignees, set Default Value to Evaluate script to get default value, and select project-owners. Open a new issue in a project with a directly assigned owner to verify the suggested assignee.
Assign to a module leader
-
Add a single-valued Enumeration field named Module, with choices Front End and Back End. Enable Include When Issue is Opened. Place Module before Assignees in the field list.
-
Add a Groovy script named
tutorial-module-leader:import io.onedev.server.util.EditContextdef moduleLeaders = ["Front End":"tutorial-reviewer-one", "Back End":"tutorial-reviewer-two"]def leader = moduleLeaders[EditContext.get().getInputValue("Module")]return leader != null ? [leader] : []Replace the example login names with existing users who have access to your project. The script reads the current issue form's Module value.
-
Set the Assignees default-value provider to this script:

-
Open a fresh issue form. With no Module selected, Assignees is empty. Selecting Front End suggests the first user; changing to Back End updates the suggestion to the second user. Save an issue and verify its assignee.

If these defaults should apply only to particular projects, add a project check to the script and return [] elsewhere. Existing issues are not reassigned by changing a default.