Skip to content

Instantly share code, notes, and snippets.

@kenglxn
Created October 8, 2018 08:26
Show Gist options
  • Save kenglxn/baf9617536fd3bca7e4e5ece26d2a355 to your computer and use it in GitHub Desktop.
Save kenglxn/baf9617536fd3bca7e4e5ece26d2a355 to your computer and use it in GitHub Desktop.
list_fb_jira_status
function list_fb_jira_status
set issues (ls ~/dev/git/sirius | grep utv-feature-sh- | grep -e '[a-zA-Z]\\+-[0-9]\\+' -o)
read -l -P 'jira username? ' username
read -l -i -P 'jira password? ' password
for issue in $issues
set -x json (curl -s -u $username:$password -X GET -H "Content-Type: application/json" "https://jira.sits.no/rest/api/2/issue/$issue?fields=status")
set issue_status (python -c 'import os,json;obj=json.loads(os.environ["json"]);status=obj["fields"]["status"]["name"];print status.encode("utf-8");')
echo $issue "(https://jira.sits.no/browse/$issue)" status: $issue_status
end
end
@kenglxn
Copy link
Author

kenglxn commented Oct 8, 2018

$ list_fb_jira_status                                                                                                                                                               ma. 08. okt. 2018 kl. jira username? k97449
jira password? ●●●●●●●●
sh-1000 (https://jira.sits.no/browse/sh-1000) status: Lukket
sh-1004 (https://jira.sits.no/browse/sh-1004) status: Under arbeid
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment