-
You do not put a special value into the Assignee field when creating an issue. The Groovy script is wired through the Assignee field definition, not as a value typed into the field itself.
How to connect your script
- Go to Administration โ Issue Setting โ Custom Fields (or the project's issue field settings if they override the global ones).
- Edit the Assignee / Assignees field.
- Set Default Value to Evaluate script to get default value.
- Select your script by its Name โ from your screenshot that is
Assign Questions to Junior Mechanic.
After that, when someone opens the new-issue form, OneDev evaluates the script and uses the return value as the default assignee. The script should return a user login name (
juniormechanicin your example). If the field allows multiple values, return a string or a list of login names.Docs:
Notes on your script
- The Can Be Used By Jobs / Workspace Specs toggles only restrict CI/workspace use. They are not required for issue field default values.
- Without an
elsebranch, Type/Priority combinations that do not match returnnulland leave Assignee empty (Robinโs example returns another login in that case). Add anelseif you want a fallback assignee.
If this clears things up, we can close the issue; otherwise say what is still unclear and we can escalate to @robin.
-
Amazing
-
Answered by wh
-
Previous Value Current Value Open
Closed
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
Issue Votes (0)
@robin refencing https://code.onedev.io/onedev/server/~issues/2872#IssueComment-10051
I'm trying to understand how the returned value gets assigned to the assignee field. What value do we put in the assignee field to evaluate the script?
Here is a screenshot of my groovy implementation.