diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index f282a3b9cd627b470e1e46276b719367e73e7714..f54d4f06627ea96e3946142f7ceabf0d79862663 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -67,9 +67,14 @@ module API
         pipeline = @project.ensure_pipeline(ref, commit.sha, current_user)
 
         status = GenericCommitStatus.running_or_pending.find_or_initialize_by(
-          project: @project, pipeline: pipeline,
-          user: current_user, name: name, ref: ref)
-        status.attributes = declared(params).slice(:target_url, :description)
+          project: @project,
+          pipeline: pipeline,
+          user: current_user,
+          name: name,
+          ref: ref,
+          target_url: params[:target_url],
+          description: params[:description]
+        )
 
         begin
           case params[:state].to_s