Created
September 5, 2016 10:32
-
-
Save baverman/46ed3f9a5fd79b80ada136fd56ca0241 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
function archiveOldReleases(dt) { | |
$('tr.project-config-version-released').each((idx, obj) => { | |
$obj = $(obj); | |
if (!$obj.hasClass('project-config-version-archived')) { | |
var rdate = $obj.attr('data-releasedate'); | |
if (rdate && rdate < dt) { | |
$.ajax({ | |
type: 'PUT', | |
url: '/rest/api/2/version/' + $obj.attr('data-id'), | |
contentType: 'application/json', | |
data: JSON.stringify({ | |
id: $obj.attr('data-id'), | |
archived: true, | |
expand: 'operations' | |
}) | |
}); | |
} | |
} | |
}); | |
} | |
archiveOldReleases('2016-07-01'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run on versions page