Skip to main content

Assign Issues to AI User

Assign an issue to an AI user to implement the work, open a pull request, respond to review feedback, and fix merge conflicts and CI/CD failures automatically.

Prerequisites

  1. An AI user is created. See Working with AI User. Project of the issue needs be entitled for the AI user, and the AI user needs to have WRITE_CODE permission over the project.

  2. A workspace is configured for the AI user for task automation. See Collaborate with AI User in Issue/PR Context.

Work on the Issue

When an issue is assigned to an AI user, OneDev first checks permissions and entitlements. If everything is in order, it creates an issue branch from the default branch and starts a workspace on that branch. With the default issue workflow, the issue transitions to Work in Progress when the branch is created:

assign issue

The Workspaces menu lists all workspaces running on the issue branch. Open the workspace link to see what the AI user is doing:

ai workspace

tip
  1. You can customize issue field settings to auto-assign certain issues to an AI user. See the Default Assignee tutorial.
  2. OneDev generates issue branch names from the issue title. For long or non-English titles, configure the lite AI model to produce shorter, correct, and more readable branch names.

Improve the Pull Request

When the job finishes, the AI user opens a pull request with the code changes. OneDev then deletes the workspace, and the default workflow transitions the issue to In Review:

create pull request

note

OneDev deletes the workspace only when the task prompt completes successfully. To keep the workspace after a successful run, disable Delete Workspace if Succeeded in the corresponding workspace spec. This is useful when the job did not produce the expected result even though the prompt completed.

At this point, a human reviewer or another AI user can review the changes, add line-anchored comments, and mention the AI user to request changes. The AI user creates a new workspace, reviews each comment, and updates the code when needed.

Fix CI/CD Errors and Resolve Merge Conflicts

If the pull request runs CI/CD jobs, the AI user attempts to fix failed builds and pushes the fix to the source branch. It also tries to resolve merge conflicts and push the result to the source branch.

This automatic remediation works when the AI user is the pull request submitter, which is the case when it opens the pull request after completing the assigned issue work.