Last active
August 10, 2017 11:25
-
-
Save jincod/1bb4681bf34ed1bff5c2d127b7e4b413 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
Function GetChangelog { | |
param($from, $to, $baseurl, $project) | |
$cred = (Get-Credential) | |
$username = $cred.GetNetworkCredential().username | |
$password = $cred.GetNetworkCredential().password | |
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($username):$($password)")) | |
git log --oneline --grep="$project-" "$from..$to" | | |
select-string "$project-(\d+)" -AllMatches | | |
Foreach-Object {$_.Matches} | | |
Foreach-Object {$_.Groups[1].Value} | | |
select -uniq | | |
sort { [int]$_} | | |
% { iwr "$($baseurl)/rest/api/2/issue/$($project)-$_" -Headers @{"Authorization" = "Basic $auth"} } | | |
ConvertFrom-Json | | |
% { "$($_.key) ($($baseurl)/browse/$($_.key)) $($_.fields.summary)"} | |
} |
Author
jincod
commented
Aug 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment