I am trying to run a curl command to get ServiceNow information and then get date. This script works fine when i run it on my mac but fails when i run it in JIRA console window
String jsonString = curl.execute().text
JsonSlurper jsonSlurper = new JsonSlurper()
Map convertedJSONMap = jsonSlurper.parseText(jsonString)
//If you have the nodes then fetch the first one only
if(convertedJSONMap."result"){
//println "u_status : " + convertedJSONMap."result"[0]."u_status"
//println "start_date : " + convertedJSONMap."result"[0]."start_date"
//println "end_date : " + convertedJSONMap."result"[0]."end_date"
def status = convertedJSONMap."result"[0]."u_status"
def s_date = convertedJSONMap."result"[0]."start_date"
def e_date = convertedJSONMap."result"[0]."end_date"
println "${status}"
println "${s_date}"
println "${e_date}"
currentDate = new Date()
println "now the time is ${currentDate}"
use( TimeCategory ) {
after30Mins = currentDate + 30.minutes
}
println after30Mins
this works, instead of using println need to use result
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.