Affects Version/s: None
Fix Version/s: 5.3.0
Sprint:Sprint 36 - Ends Oct 31, Sprint 37 - Ends Nov 14, Sprint 37 - Ends Nov 28
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.
In ViewBehaviours.groovy there is a method called getAllIssueTypes:
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.
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.
- 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.
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.
Simply remove the concatenated call to "subTaskIssueTypeObjects" and then the list should be complete with Sub-task types and no duplication.