Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3771

Single Select / Multi Select list conversion duplicates field (Behaviour) on Jira Service Desk Customer Portal

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 5.5.6, 5.6.1, 5.6.2.1-jira8, 5.6.7.1-jira8
    • Fix Version/s: 6.1.0
    • Component/s: Behaviours
    • Labels:
      None
    • Sprint:
      SR4J Sprint 77
    • Critical Points:
      6.6

      Description

      Steps to reproduce

      The problem is occurring in the Behaviour service desk.

       

      1) Use the Use Service Desk mapping for the behaviour as shown below

       
      2) Add the sample code below to the Behaviour initialiser

      def epic = getFieldByName("Epic of Change")
      epic.setReadOnly(true)
      epic.setFormValue(null)
      
      getFieldByName("Change").convertToSingleSelect([
          ajaxOptions: [
              url : getBaseUrl() + "/rest/scriptrunner-jira/latest/issue/picker",
              query: true, 
      
              data: [
                     currentJql   : "project = TEST ORDER BY key ASC",
                     label        : "Pick high priority issue in Support project",
                     showSubTasks : false,
      
              ],
              formatResponse: "issue"
          ],
          css: "max-width: 500px; width: 500px",
      ])
      

       

      3) And the sample code below Behaviour server side code:-

      def change = getFieldById(getFieldChanged())
      def epic = getFieldByName("Epic of Change")
      
      
      if(getFieldById(getFieldChanged())) { 
          epic.setFormValue(null)
          epic.setReadOnly(true)
      }
      
      
      if(change) { 
           epic.setReadOnly(false)
           epic.convertToSingleSelect(
              [
                  ajaxOptions: [
                                  url : getBaseUrl() + "/rest/scriptrunner-jira/latest/issue/picker",
                                  query : true,
                                  data : [
                                         currentJql: "project = TEST AND issueFunction in hasLinks('is caused by')",
                                              label : "Select the epic for the change",
                                         ],
                                  formatResponse: "issue"
                  ],
                  css : "max-width: 500px; width: 500px",
              ]
          )
      }
      else { 
          
          epic.convertToShortText()
          epic.setFormValue(null)
          epic.setReadOnly(true)
          
      }
      

       

       

      Current Behaviour  on Service Desk

      Multiple select options start to appear

      Expected Behaviour of Service Desk

      There should only be one select option which appears. And the number of select options should not increment.

      Additional Notes

      This problem currently only occurs using the Service Desk Mapping. Using the  project/issuetype mapping for the behaviour as shown below

      works fine

      Below is a video of my test for the service desk customer view.

      test2.mp4

        Attachments

        1. img1.png
          img1.png
          47 kB
        2. img2.png
          img2.png
          47 kB
        3. Select List Conversion Simple Bug Reproduction Service Desk.mp4
          5.71 MB
        4. test2.mp4
          1.54 MB

          Structure

            Activity

              People

              Assignee:
              jechlin Jamie Echlin
              Reporter:
              rkumar Ram Kumar Aravindakshan
              Votes:
              5 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Structure Helper Panel