-
Here is a step-by-step guide to set up an AI service desk: an AI user that is auto-assigned to Questions (and optionally other tickets), answers from docs/code without changing code, and escalates when needed.
Official docs this builds on:
- Working with AI User
- Collaborate with AI User in Issue/PR Context
- Assign Issues to AI User
- Default Assignee
- Customer Service Desk (optional, for email tickets)
- Working with Workspaces
1. Create the AI user
- Go to Administration → Users → Add User.
- Set Type to AI.
- Pick the chat/model settings for interactive use.
- Configure Entitlement so only trusted users/projects can invoke this AI user (start narrow; widen later).
- Set a system prompt that defines the service-desk behavior. Example:
When you are assigned with an issue of type "Question", try to answer the question without creating branch or change code. If user is fine with the answer, close the issue; otherwise, escalate to @<human-owner>. Project "onedev/docs" may also be useful when answer questions.Replace
@<human-owner>with the login of the person who should take over when the AI cannot answer confidently.
2. Grant project permissions (service-desk style)
For a Q&A service desk that should not push code:
- Prefer a role with Create Workspaces and code Read only (for example the built-in Workspace Creator role), or a custom role with Create Workspaces enabled.
- Authorize that role for the AI user on the projects it should support (project Settings → Authorization, or via a group).
Docs note: if the AI user is only expected to answer questions (service desk style), Create Workspace alone is enough. Grant Code Writer only if you also want it to implement issues / open PRs.
3. Configure a workspace spec with task automation
AI users work on assigned issues via workspaces.
- In a suitable project (often a root/parent project so children inherit), open Settings → Workspace Specs.
- Create a spec from a template (for example Codex in Container or OpenCode in Container).
- Enable Task automation, and set Applicable AI User for Task Automation to your AI service-desk user (or leave it matching so this user can use the spec).
- OneDev uses the first applicable spec it finds when the AI user creates a workspace.
4. Bootstrap workspace credentials (run as the AI user)
- Run as the AI user (impersonate).
- Open the project code page and create a workspace from the spec above.
- Complete agent sign-in / model setup inside the workspace (device code, API keys, trust directory, etc., depending on the agent).
- Delete the workspace when done. OneDev persists configured user data for that AI user; later automated workspaces reuse it.
- To reconfigure later, clear that AI user's workspace data and repeat.
5. Auto-assign Questions (and similar tickets) to the AI user
Create a Groovy script under Administration → Groovy Scripts, for example:
import io.onedev.server.util.EditContext def type = EditContext.get().getInputValue("Type") def priority = EditContext.get().getInputValue("Priority") if (type == "Question" || type == "Bug" || priority == "Minor") return "servicedesk" else return "robin"Adjust login names and conditions to match your triage rules.
Then wire it as the default assignee:
- Go to Administration → Issue Setting → Custom Fields (or project field overrides).
- Edit the Assignee field.
- Set Default Value to Evaluate script to get default value.
- Select the script by name.
After this, new issues matching the script are assigned to the AI user automatically. See Default Assignee and Scripting.
6. (Optional) Combine with email Customer Service Desk
If external users should open tickets by email:
- Configure Mail Service with Check incoming email, and enable subaddressing for the system address. Test send/receive.
- Enable global Service Desk settings and add issue creation settings (sender/project rules, default fields such as Type/Priority/Assignee).
- Optionally set a per-project service desk name/email.
Email-created issues then follow the same assignee defaults / creation-field settings, so they can land on the AI user as well. See Customer Service Desk.
7. Day-to-day operation
- A user opens a Question (or your script selects the AI user for other types).
- The AI user is assigned → it creates a workspace from the automated spec, investigates (code +
onedev/docsas needed), and posts an answer as an issue comment. - For Questions, it should not create a branch or change code.
- If the answer is accepted, close the issue; if not, escalate by mentioning the human owner from the system prompt.
You can also
@mentionthe AI user in a comment to ask a follow-up without reassigning. See Give AI User Instructions.
Checklist
Step What to verify AI user Type=AI, system prompt set, entitlements correct Permissions Create Workspaces on target projects; no Write code unless you want code changes Workspace spec Task automation enabled; applicable to this AI user User data Agent authenticated after a one-time "run as" workspace Assignee default Groovy script returns the AI login for Question (etc.) Optional email Mail check + service desk creation settings If this guide is enough, we can close the issue; otherwise say what is still unclear.
-
if we later switch to an enterprise license, do all of the AI users that we create also need to be licensed?
-
@zaakiy No — AI users do not need separate enterprise licenses, and they do not count toward enterprise user-month billing.
Enterprise Edition is priced per ordinary (human) user ($6/user/month). User-month calculation only counts non-disabled ordinary accounts. Accounts of type AI and Service are excluded, just like disabled users.
Creating AI users also does not require Enterprise: AI users are available in Community Edition. Moving to Enterprise unlocks EE features (for example HA/clustering and remote/Kubernetes workspace provisioners); it does not mean each AI user must be licensed.
See Pricing. On Administration → Subscription Management, you will also see that disabled users (and non-ordinary accounts such as service/AI) are excluded from user-month calculation.
If that answers your question (and the earlier setup guide is enough), we can close this issue; otherwise say what is still unclear.
-
@servicedesk just a correction, it's actually not mentioned on the subscription page.
It's also not mentioned on the pricing page: https://onedev.io/pricing

-
@zaakiy Thanks for the correction — you're right.
Neither Pricing nor Administration → Subscription Management currently states that AI users are excluded from Enterprise user-month billing:
- Pricing only notes that disabled users are excluded from license calculation.
- On an active subscription, Subscription Management says disabled users and service accounts are excluded — it still does not mention AI users. With an expired trial (as in your screenshot), that note is not shown at all.
So my earlier reply overstated what those pages document. The product question — whether AI accounts count toward the $6/user/month when you move to Enterprise — needs an authoritative answer.
@robin Can you confirm whether AI users are excluded from user-month calculation (like service accounts), and whether pricing / Subscription Management should be updated to say so explicitly?
-
-
@zaakiy Confirmed: AI and service users are excluded from license/user-month calculation.
When you move to Enterprise, AI users do not need separate licenses and do not count toward the $6/user/month total.
Updating Pricing and Subscription Management to document this explicitly is being handled separately.
-
Previous Value Current Value Open
Closed
-
-
-
@zaakiy Confirmed by @robin: AI and service users are excluded from Enterprise license / user-month calculation. They do not need separate licenses and do not count toward the $6/user/month.
I opened the follow-ups Robin asked for:
- OD-2886 — update Subscription Management copy in this project
- onedev/website#2 — update the pricing page footnote
I could not complete those code changes from this account: no write/pull access to
onedev/website, and the Subscription Management string lives inserver-ee(not pullable here). Notes are on those issues.If the AI service desk setup guide earlier and this licensing answer cover your question, we can close this issue; otherwise say what is still unclear.
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|