Skip to content

Commit

Permalink
Do not support name values for user/assignee flags
Browse files Browse the repository at this point in the history
API v3 currently only supports numeric ID and `me` as values for `user`
and `assignee` filters.
  • Loading branch information
myabc committed Feb 18, 2025
1 parent c2843df commit e2c37cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/list/work_packages_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func initWorkPackagesFlags() {
"assignee",
"a",
"",
"Assignee of the work package (can be name, ID or 'me')",
"Assignee of the work package (can be ID or 'me')",
)

workPackagesCmd.Flags().Uint64VarP(
Expand Down
5 changes: 2 additions & 3 deletions components/resources/time_entries/filters/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
)

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

type UserFilter struct {
value string
Expand All @@ -37,7 +36,7 @@ func (f *UserFilter) ShortHand() string {
}

func (f *UserFilter) Usage() string {
return `User the time entry tracks expenditures for (can be name, ID or 'me')`
return `User the time entry tracks expenditures for (can be ID or 'me')`
}

func (f *UserFilter) ValidateInput() error {
Expand Down

0 comments on commit e2c37cd

Please sign in to comment.