diff options
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 5c5190f88b1..619555f369d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -98,6 +98,8 @@ class Issue < ApplicationRecord scope :counts_by_state, -> { reorder(nil).group(:state_id).count } + scope :service_desk, -> { where(author: ::User.support_bot) } + # An issue can be uniquely identified by project_id and iid # Takes one or more sets of composite IDs, expressed as hash-like records of # `{project_id: x, iid: y}`. @@ -373,6 +375,10 @@ class Issue < ApplicationRecord ) end + def from_service_desk? + author.id == User.support_bot.id + end + private def ensure_metrics |