I am trying to write a bash function which should return me the pull request approvals count using the PR ID. I know the below API URL will provide me with the whole body of pull request response in json. I want to know if there is any other way to easily get through instead looping all the approvals in response body? Samples will help me. Please assist.
local getDetails=$(curl -w "status_code:%{http_code}\\n" -s -k -u "${User}:${Password}" -X GET "$BITBUCKET_URL/rest/api/1.0/projects/${projectCode}/repos/${repoName}/pull-requests/${prId}")
local resBody=$(echo $getDetails| sed -e 's/status_code\:.*//g')