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

Support team.profile.get method #1097

Merged
merged 1 commit into from Dec 12, 2022

Conversation

MattDavisRV
Copy link
Contributor

This PR is a duplicate of #474 that was closed due to no activity on my part. Reopening to have it merged as I believe others could benefit from it.

This PR adds support to retrieve custom fields defined on the Team, which can be populated via the users.profile.set endpoint. Profile field variables are custom to the team, so being able to retrieve them is important when setting new values. These values can also be found within the profile section of the Admin Console as noted in the comment of the function.

This PR also adds support for updating the custom fields on a user using these variables. The new function accepts a map of the existing struct UserProfileCustomField. The key of the map is the custom Team Variable to define the custom field on the user.

Note that any existing field set, but not passed to function to be updated will be cleared based on Slack's native functionality.

Pull Request Guidelines

These are recommendations for pull requests.
They are strictly guidelines to help manage expectations.

PR preparation

Run make pr-prep from the root of the repository to run formatting, linting and tests.

Should this be an issue instead
  • is it a convenience method? (no new functionality, streamlines some use case)
  • exposes a previously private type, const, method, etc.
  • is it application specific (caching, retry logic, rate limiting, etc)
  • is it performance related.
API changes

Since API changes have to be maintained they undergo a more detailed review and are more likely to require changes.

  • no tests, if you're adding to the API include at least a single test of the happy case.
  • If you can accomplish your goal without changing the API, then do so.
  • dependency changes. updates are okay. adding/removing need justification.
Examples of API changes that do not meet guidelines:
  • in library cache for users. caches are use case specific.
  • Convenience methods for Sending Messages, update, post, ephemeral, etc. consider opening an issue instead.

… Added Functionality to update User Custom Fields on their profile
@MattDavisRV
Copy link
Contributor Author

I'm not sure why the lint test is failing, I did run make pr-prep prior to putting this in and everything passed.

@kanata2
Copy link
Member

kanata2 commented Aug 22, 2022

The failure of linter check is caused by golangci-lint's upgrade, so don't worry about this 🙏

@kanata2 kanata2 changed the title Added functionality to pull user custom fields from Team information.… Support team.profile.get method method Aug 22, 2022
@kanata2 kanata2 changed the title Support team.profile.get method method Support team.profile.get method Aug 22, 2022
@kanata2 kanata2 self-requested a review August 22, 2022 21:49
users.go Show resolved Hide resolved
@kanata2 kanata2 merged commit f50586f into slack-go:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants