Last active
January 7, 2020 15:53
-
-
Save RobotRogue/4306ad92c7db545169b716c35fbf37cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The below code is to be copied/pasted into a bookmarklet URL field (remove the comments or it won't work) | |
// When viewing a Jira ticket, post to a Slack channel that you have completed the ticket | |
// Requires you have a Slack Incoming webhook configured + the webhook URL | |
// That can be set up here: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks | |
javascript: (function() { | |
const desc = document.getElementById("summary-val").innerText; | |
const ticketURL = document.URL; | |
const slackMsgStr = | |
":comet: *Finished testing:* :comet:\n- " + ticketURL + "\n- " + desc + "\n\n:white_check_mark: _Ready to Deploy!_"; | |
const data = '{"text":"' + slackMsgStr + '"}'; | |
if (data) { | |
const url = | |
"https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX"; | |
$.ajax({ | |
url: url, | |
type: "POST", | |
crossDomain: true, | |
dataType: "application/json", | |
data: data, | |
success: function(response) { | |
console.log(response); | |
}, | |
error: function(error) { | |
console.log(error); | |
} | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment