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

Can't change project key for project that has a lead with a changed username

    XMLWordPrintable

Details

    Description

      Steps to reproduce:

      1. create a project (Project1) and make User1 its project lead
      2. rename User1 to User2
      3. try to rename project key of Project1

      Outcome:
      The dialog reloads but nothing happens.

      Expected outcome:
      The project key should have been renamed.

      Cause:
      In DefaultProjectService.validateUpdateProject() we retrieve they key for the project lead:

      final ErrorCollection validationErrors = validateUpdateProjectData(directoryUser, name, oldProjectResult.getProject(),
                      ApplicationUsers.getKeyFor(lead), url, assigneeType, avatarId);
      

      However in DefaultProjectService.validateUpdateProjectData() we expect the lead name:

      private ErrorCollection validateUpdateProjectData(User user, String name, Project oldProject, String leadName,
                  String url, Long assigneeType, Long avatarId)
          {
              final ErrorCollection errorCollection = new SimpleErrorCollection();
              final I18nHelper i18nHelper = getI18nBean(user);
      
              validateProjectNameForUpdate(name, oldProject.getKey(), errorCollection, i18nHelper);
              validateProjectLead(leadName, errorCollection, i18nHelper);
              validateProjectUrl(url, errorCollection, i18nHelper);
              validateProjectAssigneeType(assigneeType, errorCollection, i18nHelper);
              validateAvatarId(avatarId, oldProject, errorCollection, i18nHelper);
      
              return errorCollection;
          }
      

      Workaround:

      1. Temporarily change the Project Lead role to an user that was never renamed (you may need to create a new user to perform this action, this user can be delete after editing the project);
      2. Edit the project key;
      3. Change the Project Lead role to the original user.

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              jderaedt Jeroen De Raedt
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: