Comments: @Mentions using the API
回答済みHi,
According to the developer notes we should be able to add mentions to comments made via the API. The syntax given @[id:username] etc does not seem to work. I did it via the UI and then queried for it, but it just gives the @ where is the user mentioned.
What is the API syntax to add a mention to another user so that its is highlighted in the UI.
Regards
-
Thanks for posting this question. I agree the documentation is unclear on how to mention a user and have their name highlighted in the comment UI.
Here's a few things to note to make this work:
- When you call the Create Comment endpoint, you specify a value for either the message or tagged_message parameter, but not both.
- When you are mentioning a user in the comment, you need to use the tagged_message parameter.
- The syntax for mentioning a user and have them highlighted in the UI is @[id:username]. For example, the syntax for a user with id=12345 and name=Don is @[12345:Don]. Username is the value of the name attribute on the User object. Please see the Ruby example below.
I'll update the documentation to clarify this.
require 'boxr' client = Boxr::Client.new('DEVELOPER_TOKEN')
#user id is 12345 and the user's name is Don comment = "@[12345:Don] test comment" file = "678" results = client.add_comment_to_file(file, message: nil, tagged_message: comment) puts results
サインインしてコメントを残してください。
コメント
1件のコメント