Using groovy to parse JSON object in shell scripts for Jenkin
问题 Say I have a JSON as following: {"id":"1.0.0-6", "version":"1.0.0", "build":6, "tag":"android-v1.0.0-6", "commitHash":"5a78c4665xxxxxxxxxxe1b62c682f84", "dateCreated":"2020-03-02T08:11:29.912Z"} I want to take out the version id from it in Jenkins Groovy file and pass the version id to a JIRA Plugin called XRAY so that it will create a build version as Label in JIRA. stage('Get App version') { steps { container('devicefarm') { steps { sh "LATEST_VERSION=$(curl ${APP_ARTIFACTORY_URL}/${XRAY