Refactor scripts names and location
This commit is contained in:
33
scripts/shell/job/jira-get-packages-with-closed-issues.sh
Executable file
33
scripts/shell/job/jira-get-packages-with-closed-issues.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
# !/bin/bash
|
||||
|
||||
GP_REPOS=(oss-package-dev/gp oss-package-rel/gp cpqd-snapshot/br/com/cpqd/etics/cpqd-etics cpqd-release/br/com/cpqd/etics/cpqd-etics)
|
||||
|
||||
echo -n Password for user "$USER":
|
||||
read -s password
|
||||
|
||||
for gp_repo in ${GP_REPOS[@]}; do
|
||||
packages_path=`jf rt search --include-dirs=true --recursive=false "$gp_repo/*" | jq -r '.[].path' | grep 'ETICS-'`
|
||||
|
||||
for package in ${packages_path[@]}; do
|
||||
package_jira=`grep -Eo 'ETICS-[[:digit:]]*' <<< "$package"`
|
||||
|
||||
jira_json=`curl --silent --user $USER:$password https://jira.cpqd.com.br/rest/api/2/issue/$package_jira`
|
||||
|
||||
jira_fields=`jq '.fields' <<< $jira_json`
|
||||
jira_status=`jq '.status.name' <<< $jira_fields`
|
||||
|
||||
if [[ $jira_status == *"Closed"* ]]; then
|
||||
jira_assignee=`jq '.assignee.name' <<< $jira_fields`
|
||||
jira_reporter=`jq '.reporter.name' <<< $jira_fields`
|
||||
|
||||
echo -e "\n"
|
||||
|
||||
echo "Pacote: \"$package\""
|
||||
echo "Jira fechado: \"$package_jira\" (https://jira.cpqd.com.br/browse/$package_jira)"
|
||||
echo "Responsável: $jira_assignee"
|
||||
echo "Reportador: $jira_reporter"
|
||||
|
||||
echo -e "\n\n\n"
|
||||
fi
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user