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

Accept user ID as authoritative field for updates #13171

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jun 15, 2023

This is a small PR that I'd like to use as a sort of test case for updating items directly through their Snipe-IT id number. It doesn't happen that often, but the use case here is that a large organization (with smaller organizations within) does a rebrand, but the rebrand isn't complete yet, so we can't just do some bulk rules on all users universally.

Since username is the unique identifier for users normally, this can make it tricky to update a user list with new usernames, since we have nothing that already exists to key off of.

This should allow you to export your users list from Snipe-IT, make your changes to your CSV, upload it those changes to the importer and - using the ID number - update the details of the users.

Signed-off-by: snipe <snipe@snipe.net>
@what-the-diff
Copy link

what-the-diff bot commented Jun 15, 2023

PR Summary

  • Added ID field to user importer
    An ID field has been introduced to the user importer for better identification of users.
  • Improved user search during import
    Now, the ID is prioritized over username when searching for users during the import process, enhancing accuracy and efficiency.

@snipe snipe requested review from uberbrady and inietov June 15, 2023 09:08
@snipe
Copy link
Owner Author

snipe commented Jun 15, 2023

@bzeus - can you give this a QA pass when you get a moment?

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if you want to do this or not - but it makes sense to not present 'ID' as an option when you're creating new and are not updating. If you wanted to do some Livewire fanciness for that, you certainly could - or just check it on the Importer side when the import is attempting to be run.

But this looks good and will definitely help our users out, even without that feature!

@snipe
Copy link
Owner Author

snipe commented Jun 15, 2023

I'm not sure - I could see IDs being useful on creation if you're importing from another Snipe-IT instance...

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair point - sounds good! Approved.

@snipe snipe merged commit f890e1f into develop Jun 15, 2023
4 checks passed
@snipe snipe deleted the features/importer/allow_update_by_user_id branch June 15, 2023 19:08
@snipe snipe changed the title Accept user ID as authoratative field for updates Accept user ID as authoritative field for updates Jun 20, 2023
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