-
-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Deleting user kills interface and tickets #408
Comments
How was the user removed? If the user is removed through the accounts page it should scan if they have any tickets and disable the user instead of deleting the user. |
Hi @polonel The user was removed via the accounts page. |
Do you have access to the database? Need to get the ID of the user from a ticket he created or assigned to. Once you have that, you will need to "recreate" his user and then run a MongoDB query to replace the new user's Something like:
This will copy the data used from the newly created user and store it in a temp obj. Replaces the temp obj |
Hi @polonel I've created another username for him, trying to recover the data in some way. I do have access to DB, however, that query shows:
The user data for the ex-team member was: So, should be Edit: Thanks again for your time. |
Sorry, the To get the _id of the original you will need to do something like:
|
Hi @polonel Thanks for the help.
So, if i'm getting this straight, the queries should be:
However,
Do i define the variables inside the mongodb cli? |
Yes inside the Mongo CLI. But it is case-sensitive. it was declared as |
Hi, it did not work at all.. And now I think I orphaned the tickets, as the ID is no longer there. Is there a way to find all references to that object ID and change them to a new one? I've seen this https://gist.github.com/vonox7/9fd5054ad9fcbf39d6c1071800647b7b |
Those queries should have not updated anything to do with the tickets. Did the user's _id update correctly? With the duplicate user removed? The tickets were already orphaned as it was unable to find a user linked. Thus that's why you were seeing the blank gui page. (errors were probably showing in browser's console) Changing all the references on all the tickets is the wrong approach. Recreating a user with the missing ID is the correct approach. I just physically tested the queries with the same situation where the owner was removed forceably. I successfully added the user back using this mention without having to change anything on the tickets. The only thing I had to do differently was remove the user before added them as the username were duplicate and the index wouldn't allow me to add it back. So in your case the queries should be.
|
Hi @polonel For the tickets, i can access the previously blank tickets again. However, for the dashboard, everything still shows blank. |
Aaaaand nevermind... Once again, thank you so much for your help @polonel We can close. |
Thanks. Yea I was about to tell you to restart the server or wait an hour and the stats should refresh once the cache invalidates. Glad I could help. |
Is this a BUG REPORT or FEATURE REQUEST?:
What happened:
User left team, we had to remove access.
Deleting the user broke interface. One of the tickets will not appear, and no stats are shown.
What did you expect to happen:
User should be disabled or removed without affecting other tickets.
As user goes away, other team members pick up his tasks and tickets.
How to reproduce it (as minimally and precisely as possible):
Create user, assign tickets, delete user.
Interface gets broken apparently.
Anything else we need to know?:
How can i fix this?
I attempted to create a user with same name and data, but issue remains.
Is there a DB query i can run to delete his tickets or assign them to other user?
Not Mongo DB knowledgeable at all.
Environment:
The text was updated successfully, but these errors were encountered: