Skip to content

Instantly share code, notes, and snippets.

@jechlin
Created September 11, 2013 20:07
Show Gist options
  • Save jechlin/6529066 to your computer and use it in GitHub Desktop.
Save jechlin/6529066 to your computer and use it in GitHub Desktop.
Adds a "view in issue navigator" link for each sprint (not the backlog).
(function ($) {
$("span[data-fieldname='sprintMarkerName'],span[data-fieldname='sprintName']").livequery(function () {
var sprintHeader = $(this);
var issueCount = sprintHeader.parent().parent().parent().find("div.ghx-issue-count");
var html = issueCount.html();
// todo: localise
if (! /View in Issue Navigator/.test(html)) {
var functionParams = "sprint =" + $(this).parent().parent().attr('data-sprint-id');
var navUrl = AJS.params.baseURL + "/issues/?jql=" + encodeURIComponent(functionParams);
issueCount.html(html + ' - <a target="_blank" href="' + navUrl + '">View in Issue Navigator</a>');
}
});
}) (AJS.$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment