Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-3132

Provide ability to transfer reported/assigned issues to another user when deleting users

    • 13
    • 171
    • Hide
      Atlassian Update – 30 March 2018

      Hi everyone,

      Thank you for your interest in this issue.

      While this suggestion has gathered significant interest, we're unable to implement all of the suggestions you make. We don't plan to work on this for the foreseeable future. This suggestion will be reviewed in about 12 months time, at which point we’ll consider whether we need to alter its status. 

      We understand this decision will be disappointing to everyone who voted for this issue. While we believe this suggestion would improve the product, after careful review of the most pressing needs of our customers, we've decided to prioritize other areas of the Jira Server roadmap, including:

      • Performance and stability improvements
      • Archiving projects for improved performance
      • Optimising the use of custom fields
      • Improving performance of boards
      • Improving Jira notifications
      • Allowing users to edit shared filters and dashboards
      • Mobile app for Jira Server

      We hope that you appreciate our candid and transparent communication. You can learn more about our approach to highly voted server suggestions here.

      To learn more on how your suggestions are reviewed, see our updated workflow for server feature suggestions.

      Kind regards,
      Jira Server Product Management

      Show
      Atlassian Update – 30 March 2018 Hi everyone, Thank you for your interest in this issue. While this suggestion has gathered significant interest, we're unable to implement all of the suggestions you make. We don't plan to work on this for the foreseeable future. This suggestion will be reviewed in about 12 months time, at which point we’ll consider whether we need to alter its status.  We understand this decision will be disappointing to everyone who voted for this issue. While we believe this suggestion would improve the product, after careful review of the most pressing needs of our customers, we've decided to prioritize other areas of the Jira Server roadmap, including: Performance and stability improvements Archiving projects for improved performance Optimising the use of custom fields Improving performance of boards Improving Jira notifications Allowing users to edit shared filters and dashboards Mobile app for Jira Server We hope that you appreciate our candid and transparent communication. You can learn more about our approach to highly voted server suggestions here . To learn more on how your suggestions are reviewed, see our updated workflow for server feature suggestions . Kind regards, Jira Server Product Management
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for JIRA Server. Using JIRA Cloud? See the corresponding suggestion.

      Original request description:

      There are a number of situations where you want to delete a user - but transfer all of their reported/assigned issues to someone else.

      We have a large number of duplicate users - and we also have had some people leave - and we want to delete them.

      "Merge Users" is the best description I can think of.

        1. failed-workaround.png
          failed-workaround.png
          30 kB
        2. image-2018-03-16-17-44-37-022.png
          image-2018-03-16-17-44-37-022.png
          23 kB
        3. script runner version 2.1.15.png
          script runner version 2.1.15.png
          21 kB
        4. wristwatch.jpeg
          wristwatch.jpeg
          6 kB

            [JRASERVER-3132] Provide ability to transfer reported/assigned issues to another user when deleting users

            Gregory Kneller added a comment - - edited

            I suggest the following script for transferring all Jira data from one username to another username (merge the user names):

            import com.atlassian.jira.component.ComponentAccessor
            import com.onresolve.scriptrunner.parameters.annotation.*
            import com.onresolve.scriptrunner.db.DatabaseUtil
            
            
            
            
            @ShortTextInput(label = "Extra User name", description = "")
            String oldUserName
            
            
            @ShortTextInput(label = "Target User name", description = "")
            String newUserName
            
            
            
            
            def getUserKeyByUsername(String username) {
                def userManager = ComponentAccessor.getUserManager()
                def user = userManager.getUserByName(username.toLowerCase())
                if (user) {
                    return user.getKey()  // This returns the user_key for the given username
                } else {
                    return null
                }
            }
            
            
            
            
            
            
            if (oldUserName?.trim() && newUserName?.trim()) {
            
            
            String oldUserKey = getUserKeyByUsername(oldUserName)
            String newUserKey = getUserKeyByUsername(newUserName)
            
            
            
            
            if (oldUserKey==null) { return "ERROR: User key for $oldUserName was not found. " } 
            if (newUserKey==null) { return "ERROR: User key for $newUserName was not found. " } 
            
            
            def SQLList=[
            "update jiraissue set assignee=? where assignee=?",
            "update jiraissue set reporter=? where reporter=?",
            "update jiraaction set updateauthor=? where updateauthor=?",
            "update jiraaction set author=? where author=?",
            "update  changegroup set author=?  where author=?",
            "update searchrequest set authorname=? where authorname=?",
            "update searchrequest set username=? where username=?",
            "update sharepermissions set PARAM1=?  where PARAM1=? and sharetype='user'",
            "update project set lead=? where lead=?",
            "update component set lead=? where lead=?",
            ]
            
            
            
            
            
            
             SQLList.each { query ->
                    DatabaseUtil.withSql('jiradb') { sql ->
                        sql.executeUpdate(query, [newUserKey, oldUserKey])
                        log.warn("Executing SQL: $query with newKey=$newUserKey and oldKey=$oldUserKey")
                    }
                }
            
            
            
            
            
            
            
            
            
            
            
            
            return ( "$oldUserName  merged into $newUserName ") 

            ⚠️ WARNING: This operation is sensitive to security and data privacy. Ensure that both usernames belong to the same individual. Merging data for different users could result in security breaches or privacy violations.

             

            Gregory Kneller added a comment - - edited I suggest the following script for transferring all Jira data from one username to another username (merge the user names): import com.atlassian.jira.component.ComponentAccessor import com.onresolve.scriptrunner.parameters.annotation.* import com.onresolve.scriptrunner.db.DatabaseUtil @ShortTextInput(label = "Extra User name" , description = "") String oldUserName @ShortTextInput(label = "Target User name" , description = "") String newUserName def getUserKeyByUsername( String username) {     def userManager = ComponentAccessor.getUserManager()     def user = userManager.getUserByName(username.toLowerCase())     if (user) {         return user.getKey()  // This returns the user_key for the given username     } else {         return null     } } if (oldUserName?.trim() && newUserName?.trim()) { String oldUserKey = getUserKeyByUsername(oldUserName) String newUserKey = getUserKeyByUsername(newUserName) if (oldUserKey== null ) { return "ERROR: User key for $oldUserName was not found. " } if (newUserKey== null ) { return "ERROR: User key for $newUserName was not found. " } def SQLList=[ "update jiraissue set assignee=? where assignee=?" , "update jiraissue set reporter=? where reporter=?" , "update jiraaction set updateauthor=? where updateauthor=?" , "update jiraaction set author=? where author=?" , "update  changegroup set author=?  where author=?" , "update searchrequest set authorname=? where authorname=?" , "update searchrequest set username=? where username=?" , "update sharepermissions set PARAM1=?  where PARAM1=? and sharetype= 'user' " , "update project set lead=? where lead=?" , "update component set lead=? where lead=?" , ] SQLList.each { query ->         DatabaseUtil.withSql( 'jiradb' ) { sql ->             sql.executeUpdate(query, [newUserKey, oldUserKey])             log.warn( "Executing SQL: $query with newKey=$newUserKey and oldKey=$oldUserKey" )         }     } return ( "$oldUserName  merged into $newUserName " ) ⚠️ WARNING: This operation is sensitive to security and data privacy. Ensure that both usernames belong to the same individual. Merging data for different users could result in security breaches or privacy violations.  

            Automation for Jira, which uses Jira users as actors and rule owners, and the software house behind which has already been bought by Atlassian, has a feature that seems to address this problem: Transfer User. I haven't tried it yet (the doc is only for the cloud, so I'm not sure if the button I can see in the Server version does anything), but if the coders who make Automation sometimes work on Jira proper, we might actually see this feature added in less than another 17 years

            Piotr Janik added a comment - Automation for Jira , which uses Jira users as actors and rule owners, and the software house behind which has already been bought by Atlassian, has a feature that seems to address this problem: Transfer User . I haven't tried it yet (the doc is only for the cloud, so I'm not sure if the button I can see in the Server version does anything), but if the coders who make Automation sometimes work on Jira proper, we might actually see this feature added in less than another 17 years

            Piotr Janik added a comment - - edited

            576ed7c5e148 YouTrack indeed supports user merging – when you delete an account, you're asked to choose a replacement account. (And only if you choose the guest account as a replacement, the references to the deleted account are replaced with Deleted User). I've used this feature many times, never had any problem with it.

            Piotr Janik added a comment - - edited 576ed7c5e148 YouTrack indeed supports user merging – when you delete an account, you're asked to choose a replacement account. (And only if you choose the guest account as a replacement, the references to the deleted account are replaced with Deleted User ). I've used this feature many times, never had any problem with it.

            A good catchy slogan yes - another one would be "Atlassian - ...."

            congo bongo added a comment - A good catchy slogan yes - another one would be "Atlassian - ...."

            Jim Ryan added a comment -

            Atlassian's new company slogan should be:
            "Atlassian – We don't support that feature and have no plans to work on it in the foreseeable future"

             

            Jim Ryan added a comment - Atlassian's new company slogan should be: "Atlassian – We don't support that feature and have no plans to work on it in the foreseeable future"  

            Gus Hauptfleisch added a comment - - edited

            Gus Hauptfleisch added a comment - - edited FWIW Linking these two tickets https://jira.atlassian.com/browse/JRASERVER-3132 and  https://jira.atlassian.com/browse/ID-240

            There's YouTrack, which does support user account merging (based on a quick Google check). Its fairly similar to Jira from my limited experience with it, just in the Jetbrains "ecosystem" rather than the Atlassian one.

            Tammy Lawn Stewart added a comment - There's YouTrack, which does support user account merging (based on a quick Google check). Its fairly similar to Jira from my limited experience with it, just in the Jetbrains "ecosystem" rather than the Atlassian one.

            Any suggestions for Jira alternatives?

            i have been using RT from BestPractical which i in 2003 found to be very very powerfull, and i am looking in that direction again. However, migrating a 16 year old jira legacy is gonna be a long run..

            congo bongo added a comment - Any suggestions for Jira alternatives? i have been using RT from BestPractical which i in 2003 found to be very very powerfull, and i am looking in that direction again. However, migrating a 16 year old jira legacy is gonna be a long run..

            Any suggestions for Jira alternatives?

            Greg Hoggarth added a comment - Any suggestions for Jira alternatives?

            No review since 30 March 2018?

            im sorry laurent, but this issue has been parked in atlassians pseudo-closed issue void called "not being considered". They claim they'll wait a year between reviews of issues in this status, however in reality here on planet earth that year is more like a decade, and the review is just another laugh from the moneymachine called atlassian.

             
            This issue was raised in 2004 - back then i had been using other issue trackers that have had this exact feature since the 1990ties.. however some 20 years later, Jira still has not got it. 

            ..... abandon ship if you can, migrate your Jira into something serious

            congo bongo added a comment - No review since 30 March 2018? im sorry laurent, but this issue has been parked in atlassians pseudo-closed issue void called "not being considered". They claim they'll wait a year between reviews of issues in this status, however in reality here on planet earth that year is more like a decade, and the review is just another laugh from the moneymachine called atlassian.   This issue was raised in 2004  - back then i had been using other issue trackers that have had this exact feature since the 1990ties.. however some 20 years later, Jira still has not got it.  ..... abandon ship if you can, migrate your Jira into something serious

              Unassigned Unassigned
              3b1ae0ec93c9 Nick Minutello
              Votes:
              493 Vote for this issue
              Watchers:
              257 Start watching this issue

                Created:
                Updated: