0

It's been a while since similar questions were asked so I thought I would try again. And, none of the existing questions speak to assigning the comment/task -- just to creating a comment.

Is it possible to programatically create a comment in a Google Sheet and assign it to someone. You can do this through the UI when you manually create a comment. If you enter an email address you can assign the comment (as a task) to them.

I know it is possible to use https://developers.google.com/drive/api/v2/reference/comments/insert to create a comment but the comment is created on the whole file, not a specific cell. And, even still, I can't find how to assign the comment.

TheMaster
  • 45,448
  • 6
  • 62
  • 85
IMTheNachoMan
  • 5,343
  • 5
  • 40
  • 89
  • 1
    If something new is announced by Google, usually those similar questions will be answered by one of us. – TheMaster Jul 07 '20 at 18:50
  • 1
    Related: https://stackoverflow.com/a/57517097/ (Even inserting is currently not possible. Assigning would be a step above that) – TheMaster Jul 08 '20 at 05:36
  • Yeah, "assignment" is not exposed in any way by the API (neither v2 you refer to, nor v3). Sheets use an undocumented `anchor` type `workbook-range` - you can try to hack around, but that would be very unreliable as I am sure you know (and that assumes you can figure out the logic behind the `range` parameter) – Oleg Valter is with Ukraine Jul 08 '20 at 16:36
  • 1
    I was able to anchor a comment to a cell so it shows the little orange arrow in the cell but it doesn't show the comment when you hover over the cell. I submitted a feature request so hoping they implement. http://issuetracker.google.com/issues/160685101 – IMTheNachoMan Jul 08 '20 at 22:47
  • @IMTheNachoMan - may I ask you how you managed to even anchor it to the cell via the API? Thank you for the feature request, btw – Oleg Valter is with Ukraine Jul 08 '20 at 22:49
  • 1
    @OlegValter I used this for the `anchor` attribute: `{"r":"head","a":[{"matrix":{"r":2,"c":2}}],"type":"workbook-range","uid":0,"range":"1493575397"}`. It shows the orange triangle but wont show the comment when you hover. I feel like there is some hidden secret. I'm still playing around with it. – IMTheNachoMan Jul 09 '20 at 23:07
  • 1
    @IMTheNachoMan - huh, I see, I stopped trying as soon as I got the confirmation that we have to use an undocumented anchor type for that (I thought that you managed to do that without it). Thank you for checking, though – Oleg Valter is with Ukraine Jul 09 '20 at 23:31

1 Answers1

2

Assigning a comment it's not possible through the API. You can only create a comment with the Drive API to a specific file.

You should submit a feature request here if you need it.

Alessandro
  • 2,848
  • 1
  • 8
  • 16