Skip to content

Commit 9371b74

Browse files
authored
Do not support name values for user/assignee flags (#8)
API v3 currently only supports numeric ID and `me` as values for `user` and `assignee` filters.
1 parent 2f290c5 commit 9371b74

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

cmd/list/work_packages_flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ func initWorkPackagesFlags() {
66
"assignee",
77
"a",
88
"",
9-
"Assignee of the work package (can be name, ID or 'me')",
9+
"Assignee of the work package (can be ID or 'me')",
1010
)
1111

1212
workPackagesCmd.Flags().Uint64VarP(

components/resources/time_entries/filters/user.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import (
1111
)
1212

1313
// validates the value is one or more of the following - separated by commas
14-
// - a valid login (see https://github.com/opf/openproject/blob/dev/app/models/user.rb#L135)
1514
// - a numeric id
1615
// - me
17-
const validValueRegexp = `^([\pL0-9_\-@.+ ]+|[0-9]+|me)(,([\pL0-9_\-@.+ ]+|[0-9]+|me))*$`
16+
const validValueRegexp = `^([0-9]+|me)(,([0-9]+|me))*$`
1817

1918
type UserFilter struct {
2019
value string
@@ -37,7 +36,7 @@ func (f *UserFilter) ShortHand() string {
3736
}
3837

3938
func (f *UserFilter) Usage() string {
40-
return `User the time entry tracks expenditures for (can be name, ID or 'me')`
39+
return `User the time entry tracks expenditures for (can be ID or 'me')`
4140
}
4241

4342
func (f *UserFilter) ValidateInput() error {

0 commit comments

Comments
 (0)