JSM Google custom incoming mail handler return errors after successful connection
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
After connecting a Google custom mail handler using the OAuth method, no incoming messages are processed.
Environment
Atlassian Cloud.
Diagnosis
The mail handler connection logs return the following errors:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden GET https://gmail.googleapis.com/gmail/v1/users/xxxxxxxxxx/messages?maxResults=300&q=in:inbox%20label:unread%20after:xxxxxxxxx { "code" : 403, "details" : ...
Retrying in XX minutes - Email pulling has failed X times consecutively (Reason: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden GET https://gmail.googleapis.com/gmail/v1/users/xxxxxxx/messages?maxResults=3...
Cause
This usually means that Jira wasn't granted access to read the messages in Google Inbox.
Solution
It's advised to reconnect the email account and make sure that the last OAuth permissions scope checkbox is selected.