Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Change Management Domain > Modifying a Change Issue
  
Modifying a Change Issue
You can modify an existing Change Issue (Problem Report or Variance) to add one or more Affected Objects by providing the required attributes and the Changeables OIDs that you want to add as Affected Objects, in the request body. The Change Issue may or may not have existing Affected Objects associated with it. You can also modify the model or soft attributes for an existing Change Issue. To create and modify Change Issues, you must have Create and Modify permissions. To modify an existing Change Issue, you must first reserve it. After you modify the Change Issue, you must unreserve it.
The Affected Objects that you want to add must exist and you must have Read permission to those. You can add the Affected Objects according to the defined association rules.
You can add any of the Changeables such as parts, documents, subtypes of parts, or subtypes of documents as Affected Objects.
* 
You cannot add Change Management Revision (BOM Redline) objects as Affected Objects to a Change Issue. If you specify any such objects to add them as Affected Objects, the request fails and returns an error.
Example: Adding Multiple Affected Objects to an Existing Problem Report
This example shows you how to add multiple Affected Objects to an existing Problem Report. In this example, the request adds four Changeables objects (parts, in this example) as Affected Objects to the existing Problem Report specified in the request URI. If the Problem Report has one existing Affected Object associated with it, then the total number of Affected Objects now associated with the Problem Report is five. Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/ChangeMgmt/ProblemReports('OR:wt.change2.WTChangeIssue:266397')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "Problem Report - Update",
"Description": "Updated DesCription",
"IssuePriority": {
"Value": "MEDIUM",
"Display": "Medium"
},
"CabinetName": "Default",
"FolderLocation": "/GOLF_CART",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:122008')",
"TeamTemplateName": "Problem Report Team",
"AffectedObjects@odata.bind": [
"Changeables('OR:wt.part.WTPart:122556')",
"Changeables('OR:wt.part.WTPart:123864')",
"Changeables('OR:wt.part.WTPart:123833')",
"Changeables('OR:wt.part.WTPart:123771')"
]
}
Example: Modifying a Model/Soft Attribute of an Existing Problem Report
This example shows you how to modify a soft attribute of an existing Problem Report specified in the request URI. Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/ChangeMgmt/ProblemReports('OR:wt.change2.WTChangeIssue:264634')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "Problem Report - Update",
"Description": "Updated DesCription",
"IssuePriority": {
"Value": "MEDIUM",
"Display": "Medium"
},
"CabinetName": "Default",
"FolderLocation": "/GOLF_CART",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:122008')",
"TeamTemplateName": "Problem Report Team",
"TestAttribute": "Test Soft Attribute updated",
"AffectedObjects@odata.bind": [
"Changeables('OR:wt.part.WTPart:122855')"
]
}
Example: Adding Multiple Affected Objects to an Existing Variance
This example shows you how to add multiple Affected Objects to an existing Variance. In this example, the request adds four Changeable objects (parts, in this example) as Affected Objects to the existing Variance specified in the request URI. If the Variance has one existing Affected Object associated with it, then the total number of Affected Objects now associated with the Variance is five. Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/ChangeMgmt/Variances('OR:wt.change2.WTVariance:266442')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "Test Deviation",
"Description": "Test Description",
"Recurring": false,
"VarianceOwners@odata.bind": "Users('OR:wt.org.WTUser:12')",
"TeamTemplateName": "Variance Team",
"ApprovedQuantity": 112,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:122008')",
"AffectedObjects@odata.bind": [
"Changeables('OR:wt.part.WTPart:122556')",
"Changeables('OR:wt.part.WTPart:123864')",
"Changeables('OR:wt.part.WTPart:123833')",
"Changeables('OR:wt.part.WTPart:123771')"
]
}
Example: Modifying a Model/Soft Attribute of an Existing Variance
This example shows you how to modify a soft attribute of an existing Variance specified in the request URI. Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/ChangeMgmt/Variances('OR:wt.change2.WTVariance:264740')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "Test Deviation",
"Description": "Test Description",
"Recurring": true,
"VarianceOwners@odata.bind": "Users('OR:wt.org.WTUser:12')",
"TeamTemplateName": "Variance Team",
"ApprovedQuantity": 162,
"TestAttribute": "Test Soft Attribute updated",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:122008')"
}