Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Clarify internal comment default as `false`

Kabiru Mwenja75648ce00ea5
diff --git a/docs/api/apiv3/components/schemas/activity_comment_write_model.yml b/docs/api/apiv3/components/schemas/activity_comment_write_model.yml
index b413c224149..b61a336b90a 100644
--- a/docs/api/apiv3/components/schemas/activity_comment_write_model.yml
+++ b/docs/api/apiv3/components/schemas/activity_comment_write_model.yml
@@ -10,7 +10,10 @@ properties:
description: The raw content of the comment
internal:
type: boolean
- description: Whether this comment is internal (only available to users with add_internal_comments permission)
+ description: |-
+ Determines whether this comment is internal. This is only available to users
+ with `add_internal_comments` permission. It defaults to `false`, if unset.
+ default: false
example:
comment:
raw: I think this is awesome!
diff --git a/spec/requests/api/v3/activities_by_work_package_resource_spec.rb b/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
index 76df6cec8bc..5c09c9a5b1e 100644
--- a/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
+++ b/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
@@ -180,6 +180,17 @@ RSpec.describe API::V3::Activities::ActivitiesByWorkPackageAPI do # rubocop:disa
expect(last_response.body).to be_json_eql(false.to_json).at_path("internal")
end
end
+
+ it_behaves_like "valid activity request" do
+ let(:permissions) { %i(view_work_packages view_internal_comments add_internal_comments) }
+ let(:status_code) { 201 }
+
+ include_context "to create internal comment", internal: nil
+
+ it "creates an internal comment" do
+ expect(last_response.body).to be_json_eql(false.to_json).at_path("internal")
+ end
+ end
end
context "and the user does not have the permission to create internal comments" do