diff --git a/.changelog/19878.txt b/.changelog/19878.txt new file mode 100644 index 000000000..aa3843f2e --- /dev/null +++ b/.changelog/19878.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix an issue where a same-named task from a different group could be selected when the user clicks Exec from a task group page where multiple allocations would be valid +``` diff --git a/ui/app/controllers/exec.js b/ui/app/controllers/exec.js index af558f66e..c55e63ffe 100644 --- a/ui/app/controllers/exec.js +++ b/ui/app/controllers/exec.js @@ -80,7 +80,10 @@ export default class ExecController extends Controller { if (this.allocationShortId) { allocation = this.allocations.findBy('shortId', this.allocationShortId); } else { - allocation = this.allocations.find((allocation) => + let allocationPool = this.taskGroupName + ? this.allocations.filterBy('taskGroupName', this.taskGroupName) + : this.allocations; + allocation = allocationPool.find((allocation) => allocation.states .filterBy('isActive') .mapBy('name')