emailgoogle-apps-scriptgoogle-sheetsgmail-apiissue-tracking

Unknown issue while runing simple Google Apps Script Code


I developed a parsing script that gets email body and title using Google Apps Script. However, when I tried to run it, after clicking on authorize button and using my relevant email address, I received this strange issue, which is blocking me to test the script. Previously there was Advanced option which lets me to proceed with running a script. Here is the screenshot:

enter image description here

In normal circumstances, it should look like this:

enter image description here

I do not know how to resolve it, kindly can you guide me to the solution? Thank you in advance.


Solution

  • Try running your script using the same account with the script ownership after signing out of all accounts or using Chrome in incognito mode with all the extensions allowed to run in incognito mode disabled.

    If the above doesn't work, try

    1. Making a copy of the script. This might be the easiest workaround. This might work if your script has exceeded a quota.
    2. Instead of relying on the automatically set oAuth scopes, set them manually using the less permissive oAuth scopes
    3. Create a Google Cloud standard to protect, enable the APIs your project requires, and add the oAuth consent script.
      • Try first setting it for private only,
      • If private only doesn't work, set it public for testing and add your email address to the authorized testers.
    4. Remove the code and libraries that are no longer required.
    5. Start from scratch, but this time pays special attention to writing high-quality code using the services and methods that require minimal permission, i.e., instead of GmailApp, use MailApp; if it's possible, avoid using DriveApp.