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

Project Search does not work if a Project has a Project Lead in a disabled directory

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

      Steps to reproduce

      1. Connect JIRA to an external user directory
      2. Create a project and set Project Lead to one of the external users
      3. Disable the external user directory, so that the Project Lead's user account is removed from JIRA
      4. Go to Projects dropdown menu -> View All Projects and perform a project search

      Expected behavior

      Projects can be filtered using the keyword

      Actual behaviors

      1. The search function does not work and projects can't be filtered
      2. The project with the external Project Lead states that it has no Project Lead:
      3. The browser URL is not appended with &contains=<keyword>
      4. The browser F12 Console shows this JS error:

      Workaround

      1. Find all the projects with the same problem from JIRA Administration -> Projects
      2. Go to their Administration Panel -> Roles -> update Project Lead to an Active User

      If there're too many projects to update, the following SQL query can be used to search for them in the database:

      select * from project where lead not in (select lower_user_name from cwd_user);

      Then the following query can be used to update the Project Lead of these projects to a valid username:

      update project set lead = '<an_active_username_in_lowercase>' where lead not in (select lower_user_name from cwd_user);

      the username must be in lowercase
      JIRA needs restarting (and maybe re-indexing) for the change to take effect

      Notes

      1. Project Search always fails under All Projects category, because it definitely contains one or more problematic projects
      2. Similarly, it fails under those Categories which contain one or more problematic projects
      3. For those Categories without a problematic project, Project Filter works, no matter how many pages there are

        1. console.png
          console.png
          21 kB
        2. project_lead.png
          project_lead.png
          9 kB
        3. projects.png
          projects.png
          15 kB

            [JRASERVER-43888] Project Search does not work if a Project has a Project Lead in a disabled directory

            Nabil Sayegh added a comment - - edited

            The query is wrong, you have to join to the directory to see if the directory is disabled: (example for sqlserver)

            SELECT p.pkey, p.lead, directory_id
            FROM project p
            JOIN cwd_user u ON (u.lower_user_name = lower(p.lead))
            JOIN cwd_directory d ON (u.directory_id = d.ID)
            WHERE d.active = 0

            Nabil Sayegh added a comment - - edited The query is wrong, you have to join to the directory to see if the directory is disabled: (example for sqlserver) SELECT p.pkey, p.lead, directory_id FROM project p JOIN cwd_user u ON (u.lower_user_name = lower(p.lead)) JOIN cwd_directory d ON (u.directory_id = d.ID) WHERE d.active = 0

            Hi everyone,

            There are few comments that this issue does not reproduce in post 7.2.0 releases. We have verified this in version 7.2.4 and can confirm this bug is resolved in this version.

            Cheers,
            Ignat
            JIRA Bugmaster.

            Ignat (Inactive) added a comment - Hi everyone, There are few comments that this issue does not reproduce in post 7.2.0 releases. We have verified this in version 7.2.4 and can confirm this bug is resolved in this version. Cheers, Ignat JIRA Bugmaster.

            Hi,

              This has been fixed after we upgrade our JIRA 7.2.0

            Mathiyalagan added a comment - Hi,   This has been fixed after we upgrade our JIRA 7.2.0

            Dom Baldin [Adobe] added a comment - - edited

            This is a plain and egregious bug. We have 1000+ projects. How you expect us to manage the project lead field like this? This needs to stop being ignored, and needs to be addressed. Adobe is not thrilled about this. Andy, can you explain why Atlassian chooses not to fix this?

            "Occurrence Factor:
            25% - affects a minority of users or feature is not regularly used" * This is funny. How do you guys come up with this figure? I, like many admins use project search NUMEROUS times DAILY.

            Dom Baldin [Adobe] added a comment - - edited This is a plain and egregious bug. We have 1000+ projects. How you expect us to manage the project lead field like this? This needs to stop being ignored, and needs to be addressed. Adobe is not thrilled about this. Andy, can you explain why Atlassian chooses not to fix this? "Occurrence Factor: 25% - affects a minority of users or feature is not regularly used" * This is funny. How do you guys come up with this figure? I, like many admins use project search NUMEROUS times DAILY.

            API User added a comment -

            This issue is reproducible on JIRA 6.4.13, but it works well on JIRA 7.2.3.

            From which version was the bug itself fixed?

            API User added a comment - This issue is reproducible on JIRA 6.4.13, but it works well on JIRA 7.2.3. From which version was the bug itself fixed?

            This issue can be identified with the following SQL query that return the project with invalid user as project lead:

            SELECT pname, pkey, lead from project WHERE lead NOT IN (SELECT user_name FROM cwd_user);
            

            Deleted Account (Inactive) added a comment - This issue can be identified with the following SQL query that return the project with invalid user as project lead: SELECT pname, pkey, lead from project WHERE lead NOT IN (SELECT user_name FROM cwd_user);

            MattS added a comment -

            We came across this in staging when we deactivated an AD user directory. We had to go to each of 53 projects, Roles, change Project Lead (which then repopulated with the right user), Save.

            Seems like a plain bug in the search code. It should ignore invalid project leads.

            MattS added a comment - We came across this in staging when we deactivated an AD user directory. We had to go to each of 53 projects, Roles, change Project Lead (which then repopulated with the right user), Save. Seems like a plain bug in the search code. It should ignore invalid project leads.

            This has a huge impact on us with our 2000 current users and we're about to go to 20,000 the impact will be much greater

            Craig Castle-Mead added a comment - This has a huge impact on us with our 2000 current users and we're about to go to 20,000 the impact will be much greater

            This bug impacts us - our workaround is to keep active users in the Project Lead field. Time-consuming but we find it keeps the search Project box working

            Lauren Eardley added a comment - This bug impacts us - our workaround is to keep active users in the Project Lead field. Time-consuming but we find it keeps the search Project box working

            Hi matt.doar,

            You're right. Deactivating a single user does not cause this problem, as long as his account is still in JIRA. To replicate the issue, we need to disable/remove the whole directory, in a sense that the user account no longer exists in JIRA. That way we can still see his username in Project Lead field, like in project_lead.png, but under View All Projects it's stated that the project has NO Project Lead. Unfortunately I can't think of a better word than Inactive to describe this user status

            Andy Nguyen (Inactive) added a comment - Hi matt.doar , You're right. Deactivating a single user does not cause this problem, as long as his account is still in JIRA. To replicate the issue, we need to disable/remove the whole directory, in a sense that the user account no longer exists in JIRA. That way we can still see his username in Project Lead field, like in project_lead.png , but under View All Projects it's stated that the project has NO Project Lead. Unfortunately I can't think of a better word than Inactive to describe this user status

              Unassigned Unassigned
              vdung Andy Nguyen (Inactive)
              Affected customers:
              21 This affects my team
              Watchers:
              38 Start watching this issue

                Created:
                Updated:
                Resolved: