Skip to content

Instantly share code, notes, and snippets.

@amanaplan
Last active August 16, 2016 17:18
Show Gist options
  • Save amanaplan/05619ad0b160d73988e076b02d79074a to your computer and use it in GitHub Desktop.
Save amanaplan/05619ad0b160d73988e076b02d79074a to your computer and use it in GitHub Desktop.
Userscript: JIRA Cloud Add Tempo Log Work Button
// ==UserScript==
// @name JIRA Add Tempo 'Log Work' button
// @namespace http://csclients.xyz/
// @updateURL https://gist.github.com/amanaplan/05619ad0b160d73988e076b02d79074a/raw/9703e2a0ec7e94da91558ffcd33d0e39862b4578/jira-cloud-add-tempo-log-work-btn.user.js
// @version 0.2
// @description Adds Tempo 'Log Work' button to JIRA hosted on Atlassian Cloud.
// @author Christian Stück <christianstuck@gmail.com>
// @match https://*.atlassian.net/browse/*-*
// @grant none
// ==/UserScript==
(function ($) {
jQuery(window).load(function () {
// If Tempo 'Log Work' operation exists
if ($('#add-hours-on-issue').length > 0) {
// Get the URI (with internal JIRA issue ID int) for the operation
href = $('#add-hours-on-issue').attr('href');
// Add the Tempo 'Log Work' button
$('<ul id="opsbar-tempo-add-hours-on-issue_container" class="toolbar-group pluggable-ops"><li class="toolbar-item toolbar-analytics"><a href="' + href + '" class="toolbar-trigger issueaction-tempo-add-hours-on-issue issueaction-tempo-log-work" title="Log Work on this Issue with Tempo" id="add-hours-on-issue-button" tabindex="-1"><span class="trigger-label">Log Work</span></a></li></ul>').insertAfter("#opsbar-assign-issue_container");
}
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment