Problem using manifest to set release parameter in pre-plan step

Document ID : KB000120100
Last Modified Date : 07/11/2018
Show Technical Document Details
Issue:
We have a Deployment Template that has a Pre-Plan Step and a Deployment Step. Both are using Release Parameters but we are no able to send the manifest for the pre-plan step.

We have the next error:

Values for some parameters are not set: [path/to/release parameter]
Environment:
CA Release Automation v6.x
Cause:
Loading manifests are not supported at the deployment template level. You can generate manifests at that level - but not load them.
Resolution:
If you have a pre-plan step with a release parameter you will need to manually give that release parameter a value before creating a deployment plan. 

An alternative to using a release parameter in a pre-plan step might be to use a deployment template property - because properties can be supplied through the run-deployment-plan rest api call and properties are available throughout each phase of the deployment (pre-plan, pre-deployment, deployment and post-deployment). 

Here is an example of the json used while calling the run-deployment-plan rest api call - including the value for a property. This test used the "ROC - Get Deployment Property" action in the pre-plan step to get and use the property value:
 

{
  "application": "Test Application",
  "build": "TestPropBuild2”,
  "deployment": "TestPropDeploy2”,
  "deploymentDescription": "TestPropDeploy2Desc",
  "deploymentPlan": "TestPropDP2”,
  "deploymentPlanDescription": "TestPropDP2 Desc",
  "deploymentPlanType": "MINOR",
  "deploymentStageToPerform": "Deployment",
  "deploymentTemplate": "propertytemplate",
  "environments": [
    "Environment for Single Server Architecture"
],
  "project": "newProj",
  "properties": { "Prop1":"TestVal2” },
  "templateCategory": "newtemplate",
  "timeout": 0
}

Additional Information:
Here is an example of the json used to create a deployment/plan from a deployment template - with a deployment step that is using a release parameter:
{
  "application": "Test Application",
  "build": "TestBuild1234DP",
  "deployment": "TestBuild1234Deploy",
  "deploymentDescription": "TestBuild1234Deploy Desc",
  "deploymentPlan": "TestBuild1234DP",
  "deploymentPlanDescription": "TestBuild1234DP Desc",
  "deploymentPlanType": "MINOR",
  "deploymentStageToPerform": "Deployment",
  "deploymentTemplate": "newdtNoRP",
  "environments": [
    "Environment for Single Server Architecture"
  ],
  "manifest": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DeploymentManifest name=\"TestBuild123DP\" project=\"newProj\" build=\"TestBuild123DP\"><properties></properties><Initialization></Initialization><Deployment><step name=\"WithRP\"><PrePlan><JPetStore_Server><JPetStore><MyReleaseParm1 templateProperty=\"false\">TestABC123</MyReleaseParm1></JPetStore></JPetStore_Server></PrePlan></step></Deployment><Post-Deployment></Post-Deployment></DeploymentManifest>",
  "project": "newProj",
  "templateCategory": "newtemplate",
  "timeout": 90
}


Note:
While testing I often received response body's like the following:
{ "result": false, "description": "Could not read JSON: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7e352842; line: 3, column: 32]\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7e352842; line: 3, column: 12] (through reference chain: com.fasterxml.jackson.module.mrbean.generated.com.nolio.liquor.dtos.api.RunDeploymentPlanApiDto[\"build\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7e352842; line: 3, column: 32]\n at [Source: org.apache.catalina.connector.CoyoteInputStream@7e352842; line: 3, column: 12] (through reference chain: com.fasterxml.jackson.module.mrbean.generated.com.nolio.liquor.dtos.api.RunDeploymentPlanApiDto[\"build\"])" }

Cause/Solution: 
The reason why this error was being returned is because I was copying/pasting the json block of text from a text editor that was corrupting the quotation mark around values. To solve it either:
a. Make sure that the characters are not being corrupted.
b. Do your copy/paste and then replace each quotation mark in the place where you are submitting the rest api call.