JIRA API 到 Google 表格 -- DNS 错误
JIRA API to Google Sheets -- DNS error
我希望对可能导致我遇到的此 DNS 错误的原因有一些见解或指示。这是我想要完成的:
我想使用他们的 API 从 JIRA 中提取数据并将数据放入预先创建的 Google Sheet
我目前可以通过 Mac 终端
使用 curl 命令和 base 64 编码连接到我们的 JIRA 环境
curl -D- -X GET -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=” -H "Content-Type: application/json" "https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000”
我曾尝试在 Google Sheet 脚本中重新创建非常相似的内容。看起来像下面这样:
function connectToJira() {
var encCred = "dXNlcm5hbWU6cGFzc3dvcmQ=";
var url = "https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000";
var options = {
"content-type": "application/json",
"headers": {"Authorization": "Basic "+encCred},
"muteHttpExceptions" : true
};
var response = UrlFetchApp.fetch(url, options);
Browser.msgBox(response.getContentText());
}
当我 运行 处于调试模式的脚本时,它突出显示...
var response = UrlFetchApp.fetch(url, options);
... 并给出以下错误:
DNS error: https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000
(line 12, file "Code") Dismiss
当我展开所有变量时,我可以看到 "response" 返回为未定义。
关于如何克服这个问题的任何想法或线索?可能有一个简单的步骤,我遗漏了一些我不知道的地方,或者我只是缺乏理解。谢谢!
https://jira.ourworkdomain.com可以public在互联网上访问吗?
如果没有,这将不起作用。 URL Fetch 服务从 Google public IP 地址向 public Internet 发出请求。
来自URLFetchApp class documentation:
This service allows scripts to communicate with other applications or
access other resources on the web by fetching URLs.
...
Requests made
using this service originate from a set pool of IP ranges. You can
look up the full list of IP addresses if you need to whitelist or
approve these requests.
我希望对可能导致我遇到的此 DNS 错误的原因有一些见解或指示。这是我想要完成的:
我想使用他们的 API 从 JIRA 中提取数据并将数据放入预先创建的 Google Sheet
我目前可以通过 Mac 终端
使用 curl 命令和 base 64 编码连接到我们的 JIRA 环境
curl -D- -X GET -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=” -H "Content-Type: application/json" "https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000”
我曾尝试在 Google Sheet 脚本中重新创建非常相似的内容。看起来像下面这样:
function connectToJira() {
var encCred = "dXNlcm5hbWU6cGFzc3dvcmQ=";
var url = "https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000";
var options = {
"content-type": "application/json",
"headers": {"Authorization": "Basic "+encCred},
"muteHttpExceptions" : true
};
var response = UrlFetchApp.fetch(url, options);
Browser.msgBox(response.getContentText());
}
当我 运行 处于调试模式的脚本时,它突出显示...
var response = UrlFetchApp.fetch(url, options);
... 并给出以下错误:
DNS error: https://jira.ourworkdomain.com/rest/api/2/issue/XXX-1000 (line 12, file "Code") Dismiss
当我展开所有变量时,我可以看到 "response" 返回为未定义。
关于如何克服这个问题的任何想法或线索?可能有一个简单的步骤,我遗漏了一些我不知道的地方,或者我只是缺乏理解。谢谢!
https://jira.ourworkdomain.com可以public在互联网上访问吗?
如果没有,这将不起作用。 URL Fetch 服务从 Google public IP 地址向 public Internet 发出请求。
来自URLFetchApp class documentation:
This service allows scripts to communicate with other applications or access other resources on the web by fetching URLs.
...
Requests made using this service originate from a set pool of IP ranges. You can look up the full list of IP addresses if you need to whitelist or approve these requests.