Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update user.go #439

Merged
merged 4 commits into from
Feb 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,30 @@ func WithInactive(inactive bool) userSearchF {
}
}

// WithUsername sets the username to search
func WithUsername(username string) userSearchF {
return func(s userSearch) userSearch {
s = append(s, userSearchParam{name: "username", value: username})
return s
}
}

// WithAccountId sets the account id to search
func WithAccountId(accountId string) userSearchF {
return func(s userSearch) userSearch {
s = append(s, userSearchParam{name: "accountId", value: accountId})
return s
}
}

// WithProperty sets the property (Property keys are specified by path) to search
func WithProperty(property string) userSearchF {
return func(s userSearch) userSearch {
s = append(s, userSearchParam{name: "property", value: property})
return s
}
}

// FindWithContext searches for user info from Jira:
// It can find users by email or display name using the query parameter
//
Expand Down