From: dklawren Date: Mon, 14 Oct 2019 14:26:54 +0000 (-0400) Subject: Bug 1587849 - Cannot create markdown comments via the REST API X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d129284bd79e121a8b1782407b97000b1a1d56a2;p=thirdparty%2Fbugzilla.git Bug 1587849 - Cannot create markdown comments via the REST API --- diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index d0b405244..39e9b932c 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -1191,8 +1191,15 @@ sub add_comment { } # Append comment - $bug->add_comment($comment, - {isprivate => $params->{is_private}, work_time => $params->{work_time}}); + $bug->add_comment( + $comment, + { + isprivate => $params->{is_private}, + work_time => $params->{work_time}, + is_markdown => + ( defined $params->{is_markdown} ? $params->{is_markdown} : 0 ) + } + ); # Add comment tags $bug->set_all({comment_tags => $params->{comment_tags}}) diff --git a/docs/en/rst/api/core/v1/comment.rst b/docs/en/rst/api/core/v1/comment.rst index ee66170d8..b453f40ba 100644 --- a/docs/en/rst/api/core/v1/comment.rst +++ b/docs/en/rst/api/core/v1/comment.rst @@ -144,7 +144,8 @@ To create a comment on a current bug. { "ids" : [123,..], "comment" : "This is an additional comment", - "is_private" : false + "is_private" : false, + "is_markdown" : true } ``ids`` is optional in the data example above and can be used to specify adding @@ -160,6 +161,8 @@ ids array List of integer bug IDs to add the comment to. did not set the ``comment`` parameter. is_private boolean If set to true, the comment is private, otherwise it is assumed to be public. +is_markdown boolean If true, the comment will be rendered as markdown. + (default: false) work_time double Adds this many hours to the "Hours Worked" on the bug. If you are not in the time tracking group, this value will be ignored.