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

The associate priority scheme project selector is prone to error

XMLWordPrintable

    • 2
    • 6
    • 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.

      Jira Server Version: v7.6.1#76002

       

      The "Associate priority scheme" screen has a multi-select box for selecting which projects to associate with the Priority scheme. The issue that we have run into a few times is losing the current selections by inadvertently not holding the control key when selecting a project. These list may be long and it is difficult to recover. Sisnce it only shows the 

      It would be much safer to have an interface where you can add and remove projects instead, similar to the way users are added to groups.

      Workaround

      As a workaround the Jira administrator may want to customize the Associate priority scheme screen to show projects as a checkbox list.
      It's important to note this is not a recommendation from Atlassian and would not be covered through the Atlassian Support offerings.

      The administrator may choose to add the following JS script to the announcement banner or to use it as part of a ScriptRunner web resource fragment.

      <script type="module">
      
      // Function to convert a select element into a checkbox list
      function transformSelectToCheckboxList(selectSelector) {
          // Find the select element
          const selectElement = document.querySelector(selectSelector);
          if (!selectElement) return;
      
          // Create a container div for the checkbox list
          const checkboxContainer = document.createElement('div');
          checkboxContainer.className = 'checkbox-list';
      
          // Iterate over the options in the select element
          Array.from(selectElement.options).forEach(option => {
              // Create a label for each checkbox
              const label = document.createElement('label');
              label.style.display = 'block';
      
              // Create the checkbox input
              const checkbox = document.createElement('input');
              checkbox.type = 'checkbox';
              checkbox.name = selectElement.name;
              checkbox.value = option.value;
              checkbox.checked = option.selected;
      
              // Append checkbox and text to the label
              label.appendChild(checkbox);
              label.appendChild(document.createTextNode(option.textContent.trim()));
      
              // Append the label to the container
              checkboxContainer.appendChild(label);
          });
      
          // Insert the checkbox container after the select element
          selectElement.parentNode.insertBefore(checkboxContainer, selectElement.nextSibling);
      
          // Hide the original select element
          selectElement.style.display = 'none';
      }
      
      
      document.addEventListener('DOMContentLoaded', function() {
          if (window.location.pathname.includes("/secure/admin/AssociatePriorityScheme!") || window.location.pathname.includes("/secure/project/AssociatePriorityScheme!default.jspa")) {
              transformSelectToCheckboxList('select[name="projects"]');
          }
      });
      </script>
      



      Here's an example when this workaround is applied.

      • Associate priority scheme screen without the workaround.
      • Associate priority scheme screen with the workaround.

        1. screenshot-2.png
          screenshot-2.png
          226 kB
        2. screenshot-1.png
          screenshot-1.png
          115 kB

              Unassigned Unassigned
              1bff7c2220ab Frank Falcone
              Votes:
              66 Vote for this issue
              Watchers:
              39 Start watching this issue

                Created:
                Updated: