summaryrefslogtreecommitdiff
path: root/app/services/issues/after_create_service.rb
blob: 011a78029c8bc4882d4d1cd87be8344eb40a5000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Issues
  class AfterCreateService < Issues::BaseService
    # TODO: this is to be removed once we get to rename the IssuableBaseService project param to container
    def initialize(container:, current_user: nil, params: {})
      super(project: container, current_user: current_user, params: params)
    end

    def execute(issue)
      todo_service.new_issue(issue, current_user)
      delete_milestone_total_issue_counter_cache(issue.milestone)
      track_incident_action(current_user, issue, :incident_created)
    end
  end
end

Issues::AfterCreateService.prepend_mod