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

Behaviour Mapping Setup shows duplicate Sub-task issue types

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Sprint 36 - Ends Oct 31, Sprint 37 - Ends Nov 14, Sprint 37 - Ends Nov 28
    • Critical Points:
      0

      Description

      Description

      When you try to set up a mapping for a behaviour in SR, you are asked to choose the issue types that it is applicable for. That list is populated with the issue types and Sub-task issue types. The Sub-task issue types, however, are duplicated.

      Cause

      In ViewBehaviours.groovy there is a method called getAllIssueTypes:

      Collection getAllIssueTypes () {
          ConstantsManager constantsManager = ComponentAccessor.getConstantsManager()
          constantsManager.allIssueTypeObjects + constantsManager.subTaskIssueTypeObjects
      }
      

      Here we concatenate the collection from the output of "allIssueTypeObjects" and "subTaskIssueTypeObjects". Unfortunately "allIssueTypeObjects" already provides us with the sub-task types, whence the duplication.

      Steps To Reproduce

      There are two ways to reproduce this issue. The first is via the UX, I have also written a script to demonstrate this in more detail.

      User Experience

      1. Open JIRA and log in with an administrative user.
      2. Select "Add-ons" from the administration (gear) menu
      3. Click "Behaviours"
      4. Create a new Behaviour (name: Test, description: Test)
      5. In the "Operations" next to our new behaviour, click the "Add Mapping" link
      6. Find the "* Issue Types:" multi-select box and scroll to the bottom

      At this point you should notice that Sub-task is presented twice. This is the Sub-task type presented twice.

      If you want further verification you can create an additional Sub-task and you will see that it too is presented twice.

      Script

      You can test this issue / verify the source by using the attached Groovy script.

      If you run the script from your Script Console, it will display outputs of "allIssueTypeObjects" and "subTaskIssueTypeObjects" in separate tables. You can see from the issue ID's that they are definitely duplicates and that they come from the "subTaskIssueTypeObjects" call.

      Proposed Resolution

      Simply remove the concatenated call to "subTaskIssueTypeObjects" and then the list should be complete with Sub-task types and no duplication.

        Attachments

          Activity

            People

            Assignee:
            scheesley Stephen Cheesley
            Reporter:
            scheesley Stephen Cheesley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: