|
|
|
@@ -29,6 +29,8 @@ class Api::V1::Issues::CreateService < ApplicationService |
|
|
|
@assigner_ids = params[:assigner_ids] |
|
|
|
@attachment_ids = params[:attachment_ids] |
|
|
|
@receivers_login = params[:receivers_login] |
|
|
|
@pm_project_id = params[:pm_project_id] |
|
|
|
@pm_sprint_id = params[:pm_sprint_id] |
|
|
|
end |
|
|
|
|
|
|
|
def call |
|
|
|
@@ -57,7 +59,8 @@ class Api::V1::Issues::CreateService < ApplicationService |
|
|
|
@created_issue.assigners = @assigners unless assigner_ids.blank? |
|
|
|
@created_issue.attachments = @attachments unless attachment_ids.blank? |
|
|
|
@created_issue.issue_tags = @issue_tags unless issue_tag_ids.blank? |
|
|
|
|
|
|
|
@created_issue.pm_project_id = @pm_project_id |
|
|
|
@created_issue.pm_sprint_id = @pm_sprint_id |
|
|
|
@created_issue.issue_tags_value = @issue_tags.order("id asc").pluck(:id).join(",") unless issue_tag_ids.blank? |
|
|
|
@created_issue.save! |
|
|
|
|
|
|
|
@@ -135,6 +138,7 @@ class Api::V1::Issues::CreateService < ApplicationService |
|
|
|
end |
|
|
|
|
|
|
|
def build_issue_project_trends |
|
|
|
return if @project.id == 0 |
|
|
|
@created_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: "create"}) |
|
|
|
@created_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE}) if status_id.to_i == 5 |
|
|
|
end |
|
|
|
|