I get this invalid argument when I include "created:<=2021-06-18 " as part of the query
var query = "search/issues?q=is:issue+label:kind/bug+state:open+created:<2021-06-18"
if (service.hasAccess()) {
Logger.log("App has access.");
// var api = baseURL + query + endDate;
var api = baseURL + query;
var headers = {
"Authorization": "Bearer " + getGithubService_().getAccessToken(),
"Accept": "application/vnd.github.v3+json"
};
var options = {
"headers": headers,
"method" : "GET",
"muteHttpExceptions": true
};
var response = UrlFetchApp.fetch(api, options); // exception happens here
However if I copy the URL as displayed in the exception message and paste it into the browser I get the expected result.
If I remove the "created:<2021-06-18" portion and run the code all goes fine.