Last active
March 1, 2022 23:51
-
-
Save peterneave/c998b885ffc9299e02a5ca1e834b9b15 to your computer and use it in GitHub Desktop.
Go to Jira from Source Tree
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
#Script to Run: C:\Program Files\PowerShell\7\pwsh.exe | |
#param: c:\dev\GoToJira.ps1 $REPO $SHA | |
Param( | |
[string]$REPO, | |
[string]$SHA | |
) | |
pushd $REPO | |
$var = (git log -n 1 --pretty=medium $SHA) | Out-String | |
popd | |
$regex = '((?<!([A-Za-z]{1,10})-?)[A-Z]+-\d+)' | |
$var -match $regex | Out-Null | |
$ticket = $Matches[0] | |
$url = "https://insertyourteamhere.atlassian.net/browse/$ticket" | |
#& "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" $url | |
& "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" $url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment