Details
-
Bug
-
Status: Done
-
Low
-
Resolution: Fixed
-
None
-
None
-
None
-
Sprint 36 - Ends Oct 31, Sprint 37 - Ends Nov 14, Sprint 37 - Ends Nov 28
-
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
- Open JIRA and log in with an administrative user.
- Select "Add-ons" from the administration (gear) menu
- Click "Behaviours"
- Create a new Behaviour (name: Test, description: Test)
- In the "Operations" next to our new behaviour, click the "Add Mapping" link
- 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.