I am trying to update a resource to set the inherit team to true in urbanCode deploy using the groovy script below.
def ucdURL = "${p:server.url}";
def response = ""
def ucdURLCLI = ""
def ucdAPICaller = new APIRequests();
ucdAPICaller.setSSL()
ucdURLCLI = "/cli/resource/update?"
response = ucdAPICaller.putRequest(path: ucdURL + ucdURLCLI, resource="/This/Is/My/Test/Resource", contentType: application/json, requestContentType: JSON, body: [inheritTeam:"true"])
class APIRequests{
static def putRequest(String httpUrl, params) {
String urlParam = ""
String httpUrlFinal = ""
String type = "PUT"
def putResp
if (params != null)
{
urlParam = addParamData(params);
}
httpUrlFinal = httpUrl + urlParam
URL ucdUrl = new URL(httpUrlFinal);
println(ucdUrl)
//Create HTTP Connection
putResp = this.createHTTPConn(ucdUrl, type)
return putResp.getResponseCode();
}
But I am getting the below error: Caught: groovy.lang.MissingPropertyException: No such property: json for class: groovy_script_1511883629920988906 groovy.lang.MissingPropertyException: No such property: json for class: groovy_script_1511883629920988906 at groovy_script_1511883629920988906$_run_closure6_closure9.doCall(groovy_script_1511883629920988906.groovy:130) at groovy_script_1511883629920988906$_run_closure6.doCall(groovy_script_1511883629920988906.groovy:129) at groovy_script_1511883629920988906.run(groovy_script_1511883629920988906.groovy:125) Caught: com.urbancode.air.ExitCodeException: Command failed with exit code: 1 com.urbancode.air.ExitCodeException: Command failed with exit code: 1 at com.urbancode.air.CommandHelper.runCommand(CommandHelper.groovy:211) at com.urbancode.air.CommandHelper$runCommand$0.callCurrent(Unknown Source) at com.urbancode.air.CommandHelper.runCommand(CommandHelper.groovy:125) at com.urbancode.air.CommandHelper$runCommand.call(Unknown Source) at run_groovy_script.run(run_groovy_script.groovy:77)
REST API teamsecurity resource not working 2 Answers
AppScan Enterprise REST API: "Access is denied." 1 Answer
What type of encoding does udeploy expect to import a generic process in the multipart webform? 2 Answers
Start BPD from IID via REST service (HTTP Import) with Business Data 2 Answers
How to add worklog to SR / incident via MAXIMO REST API? 1 Answer