View Issue Details

IDProjectCategoryView StatusLast Update
0007260mantisbtplug-inspublic2013-06-06 05:35
Reportercas Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Summary0007260: Moving multiple issues from an obsolete user to an existing user
Description

In case you want to delete a user, Mantis shows odd behavior when issues are updated in case they are related to this particular user.
Untill now i did not find a proper solution so created 2 scripts which allow me to move all reference from one user to another throughout the mantis environment.
Includes support for FAQ and Timetracking add-ons.

Additional Information

The process for removing a user would be:

  1. Disable the user
  2. use this script to convert all references
  3. Delete the user
Tagspatch, plugin
Attached Files
syncusers.zip (3,389 bytes)
syncusers modified.zip (4,215 bytes)
Syncuser95.zip (5,897 bytes)
Syncuser.96.zip (5,836 bytes)
Syncuser098.zip (5,991 bytes)
Syncuser099.zip (6,188 bytes)
Syncuser100.zip (6,247 bytes)

Relationships

related to 0010141 feedback Disabled users are no more liste in filter 
related to 0003116 closeddregad If a user reports a bug, and gets purged for inactivity, updating the bug changes the username 

Activities

vboctor

vboctor

2006-07-29 02:04

manager   ~0013165

Thanks for the script. In my opinion the proper solution is for Mantis to populate the list of users in update as follows:

  • Populate all active users that match the required criteria (basically what we have now).

  • Add the current user to the list in case it's disabled. This makes sure that the current behaviour where the first user in the list is selected because the current user is not available in the combobox.

If you provide a patch for this, I can integrate it into Mantis 1.1.

cas

cas

2006-07-30 06:32

reporter   ~0013169

Would the following be a proper alternative :

  1. Delete user
  2. Mantis checks for references to this user
    2a1. If not found, simply delete
    2b1. If found, Mantis asks for replacement user`
    2b2. Replacement user could be defaulted through variable in config_inc
    2b3. If no replacement, No delete, just disable
    2b4. If proper replacement, delete user
emathieu

emathieu

2006-10-20 09:58

reporter   ~0013630

I slightly modified cas job to replace entries for user id with drop down lists.
I also provide a patch for adding a submenu for [manage users] menu.
Refer to syncuser modified.zip

cas

cas

2009-03-24 05:26

reporter   ~0021176

Will transfer this one into a plugin for 1.2.0

cas

cas

2009-03-25 04:14

reporter   ~0021185

Attached a plugin to be used as of version 1.2.0

alitvak

alitvak

2010-04-22 12:45

reporter   ~0025204

I installed plugin but it doesn't work. When I converge from one user to another I get this message

Database query failed. Error received from database was 0001146: Table 'bugtracker.mantis_project_category_table' doesn't exist for the query: update mantis_project_category_table set user_id=2 where user_id=304.

cas

cas

2010-04-24 02:21

reporter   ~0025240

I will review this plugin over the next few days and provide fix.

cas

cas

2010-04-26 02:29

reporter   ~0025256

Please verify if all fixed in version 0.96

matthew.bowman

matthew.bowman

2010-11-30 11:22

reporter   ~0027517

Last edited: 2010-11-30 11:42

would this work for two user accounts, both with data/issues? ie merge one to another, preserve the others data?

I tried and recieved..

Database query failed. Error received from database was 0001062: Duplicate entry '6-2079' for key 1 for the query: update mantis_project_user_list_table set user_id=2079 where user_id=111

matthew.bowman

matthew.bowman

2010-11-30 12:29

reporter   ~0027518

seems I had to remove the sync from user from the project, or else they would conflict after the sync.

cas

cas

2010-12-01 02:50

reporter   ~0027521

Last edited: 2010-12-01 03:01

@Matthew,
this indeed is a bug. Fixed this in version 0.98.
In principle there is no reason to remove the user. The project_user_list table should only be reviewed by project where it now was updating in one go. This however can lead to upsetting the primary index.

cas

cas

2010-12-01 03:01

reporter   ~0027522

Last edited: 2010-12-01 03:01

Version 0.98 loaded due to an existing typo. Would appreciate if someone can delete syncuser097.zip

baamster

baamster

2012-03-15 05:36

reporter   ~0031471

@cas Nice plugin. However, I now have converted my whole history instead of only the assigned to user. I would like to know who entered issues in the past and have the complete history available....is that possible as well?

cas

cas

2012-03-16 11:29

reporter   ~0031480

Could be an option in a next version...........
Is not a difficult change, simply adding Checkbox to convert only issues with a certain status.

cas

cas

2012-03-27 03:40

reporter   ~0031539

Added an option to only convert active issues

baamster

baamster

2012-04-03 03:27

reporter   ~0031591

@cas That is indeed an improvement. However, active issues should have a remaining history as well. I don't want (e.g.) the reporter to change, only the "assigned to" since I need to know from whom the issue originated and what happened in the meantime....

That status is the most improtant because no-one picks up issues that are assigned to other people...

cas

cas

2012-04-03 05:22

reporter   ~0031592

So that can be achieved relative easy in standard Mantis.
Simply filter this user in the View Issues option
Select all
Assign to someone else
Done !

baamster

baamster

2012-04-13 02:11

reporter   ~0031647

That is not possible since the user is disabled and therefore not visable in the filter anymore. That means I have to enable him, then filter, reassign and disable again. Fine if it is one user, but we are talking about 50 users...lot of work....

cas

cas

2012-04-13 03:25

reporter   ~0031648

In that case, use the latest version where you can specify alow and a high limit for the status. Issues within the range will be handled.
In your case, simply set both to "assigned"

baamster

baamster

2012-04-13 08:06

reporter   ~0031650

A, cheers...however:
APPLICATION ERROR 0000401
Database query failed. Error received from database was 0001064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=> 15' at line 1 for the query: update mantis_bug_tag_table set user_id=264 where user_id=130 and status <= 15 and status => 15.