From e043cb10e82d68d0b3f1839c3171aac53f0fe502 Mon Sep 17 00:00:00 2001 From: Daniel Vijge Date: Thu, 18 Feb 2016 09:42:44 +0100 Subject: [PATCH] Additional status change didn't limit tracker --- README.md | 2 +- app/models/issue_status_changer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fabf62..eeb9994 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Issue Status Changer # +# Redmine Issue Status Changer # This module defines three `rake` tasks for automatically changing the issue status. diff --git a/app/models/issue_status_changer.rb b/app/models/issue_status_changer.rb index 06a2103..077db47 100644 --- a/app/models/issue_status_changer.rb +++ b/app/models/issue_status_changer.rb @@ -82,7 +82,7 @@ def self.__change_issues_on_subtask_status() old_status = settings[:new_status]['additional_from'][tracker] new_status = settings[:new_status]['additional_to'][tracker] - Issue.where("id IN (SELECT subtasks.parent_id from issues AS subtasks WHERE subtasks.status_id IN (#{new_status}) AND subtasks.parent_id=`issues`.id)").each do |issue| + Issue.where("tracker_id=#{tracker} AND id IN (SELECT subtasks.parent_id from issues AS subtasks WHERE subtasks.status_id IN (#{new_status}) AND subtasks.parent_id=`issues`.id)").each do |issue| i = Issue.find issue.id if is_higher_status(i.status_id, new_status) then