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

XMLWordPrintable

    • 6

      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.

            Assignee:
            Oswaldo Hernandez (Inactive)
            Reporter:
            Jeroen De Raedt
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: