【やりたいこと】
JIRAからボタン付きのメールを送信し、そのメールからボタンを押したらJIRAにWebhookを送信できるようにしたい。
【できないこと】
画像の通り、メールの送信はできたのですが、ボタンを押してもWebhookが受信できませんでした。なぜでしょうか?
メールのコンテンツを置いておきます。
利用しているメールツールはOutlookです。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button Webhook</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td bgcolor="#1a49ea" align="center" style="border-radius: 4px; height: 40px; width: 200px;">
<!-- ダミーURLに置き換えました -->
<a href="https://example.com/jira/settings/automation" onclick="sendWebhook(event)" style="font-family: sans-serif; font-size: 13px; color: #ffffff; text-decoration: none; line-height: 40px; display: inline-block; width: 100%;">出勤・退勤</a>
</td>
</tr>
</table>
<script>
function sendWebhook(event) {
event.preventDefault(); // ページ遷移を抑制
var xhr = new XMLHttpRequest();
// ダミーURLに置き換えました
var url = "https://example.com/pro/hooks/dummy-webhook-url";
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
var data = JSON.stringify({
event_type: "attendance",
status: "checked_in",
timestamp: new Date().toISOString()
});
xhr.send(data);
// ダミーURLに置き換えました
setTimeout(function() {
window.location.href = "https://example.com/jira/settings/automation";
}, 1000); // 1000ミリ秒(1秒)後に遷移
}
</script>
</body>
</html>
アトラシアンコミュニティをご利用いただきありがとうございます。
時間が経った中での回答失礼いたします。
恐縮ながらAPIなど開発関連のお問い合わせは、 Atlassian Developer Community の利用をご検討いただけますとさいわいです。投稿は[community.developer.atlassian.com] > *New Topic* より行なえます。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.