Created
November 5, 2014 19:23
-
-
Save hashbrowncipher/62afd5f82b23af208c35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name JIRA Issue Change Notifier | |
// @include https://jira.example.com/browse/* | |
// ==/UserScript== | |
var checkInterval = 5000; | |
var issueKey = JIRA.Issue.getIssueKey(); | |
var updatedDate = new Date(jQuery('span#updated-date time')[0].dateTime).getTime() | |
var isIssueUpdated = function() { | |
jQuery.ajax({ | |
dataType: 'json', | |
url: "/rest/api/2/search?jql=updated > " + updatedDate + " and issue=" + issueKey + "&maxResults=0", | |
success: function(data) { | |
if ( data.total != 0) { | |
jQuery('.aui-page-header').css('background-color', 'red'); | |
} else { | |
setTimeout(isIssueUpdated, checkInterval) | |
} | |
}, | |
error: function() { | |
setTimeout(isIssueUpdated, checkInterval) | |
}, | |
timeout: 10000, | |
}); | |
} | |
isIssueUpdated(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment