title: Google Doc comments - Update using Appscript
body: <p>I hope everyone is in good health. I am new to <em>AppScript</em> and love the concept of automating the Google Docs using it.</p>
  <p><strong>What I tried;</strong><br />
  I recently got into a problem where I needed to update the text according to its comment in Google Docs using AppScript.<br />
  Here is the demo<a href="https://i.stack.imgur.com/ggEg3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ggEg3.png" alt="enter image description here" /></a>  but I came to know that it was not possible by using AppScript, so I have to use <em>Google Drive API</em> and I tried it but I still didn't got successful. It did seem to be changed when I try <code>console.log(comments.items[i].context.value);</code> but everything was same in my Google Doc, nothing seem to be changed.</p>
  <p>Here is my <strong>code</strong>;</p>
  <pre class="lang-js prettyprint-override"><code>function listComments() {
    let comments = Drive.Comments.list(DocumentApp.getActiveDocument().getId());
  
    if (comments.items &amp;&amp; comments.items.length &gt; 0) {
      for (let i = 1; i &lt; comments.items.length; i++) {
        let comment = comments.items[i].content;
        let text = comments.items[i].context.value;
        comments.items[i].context.setValue(`[${text}](${comment})`);
        console.log(comments.items[i].context.value);
      }
    } else {
      Logger.log('No comment found.');
    }
  }
  </code></pre>
  <p>I can't find the documentation anywhere for updating the <strong>Comment Context Value</strong> in AppScript which will also reflect in my Google Doc.<br />
  I hope you will be able to address my problem. <strong>Thanks</strong> in Advance !</p>