<span class="bold">Audit a Change Order Using REST</span>
Audit Specific Status of a Change Order
You can use the productWorkflowActions REST API resource to audit a change order that's not in Draft status. User can perform audit for these scenarios:
- Audit specific status of a change order
- Audit Current and Future statuses of a change order
For Current and Next statuses, users see errors, and for the Future status the violations are shown as warnings.
Let's discuss these scenarios in which Alice, a change analyst, for example, wants to make sure she populated all the attributes that are required after movin the change order to Open status, so the assignee can smoothly transit the change order to the next status. She will use the REST API to perform this action:
Audit violations on change order ECO001, which is currently in Open status. This would give her the audit results configured on this status:
- Errors:
- Violation on Open status: Need-by Date value is required.
- Violation on Interim Approval 2 Status: zBIACOLineDFF value and CHLI_Glob_Seg_Char_1 value are required on affected items PNDOCITEM2.
- Structure Lifecycle Phase Inconsistency Validation: Item AuditItem-Child can't be in a lower lifecycle phase than the parent item.
- Warnings:
-
Violation on Approval Status: Priority value is required.
-
Example URL
Use this resource URL format:
POST
fscmRestApi/resources/version/productWorkflowActions/action/auditAnalysiscURL
Commandcurl -u username:password -X PATCH -H "Content-Type:application/vnd.vision.adf.resourceitem+json" -d 'request payload' "https://servername/fscmRestApi/resources/version/productWorkflowActions/action/auditAnalysis"
Example Request
{
"workflowParams":
{ "ChangeId": "300100666332995",
"ChangeINotice": "ECO001",
"OrganizationCode": "V1"
}
}Example Response
Here's an example of the response body in JSON format:
{
"result": {
"Open": {
"SequenceNumber": "10",
"StatusName": "Open",
"StatusCode": “1”,
"Entry Criteria": {},
"Exit Criteria": {
"General Information": [
{
"severity": "ERROR",
"message": "Need-by Date value is required."
}
]
}
},
"Interim Approval 2": {
"SequenceNumber": "20”,
"StatusName": "Interim Approval 2",
"StatusCode": "300100185401796",
"Entry Criteria": {
"PNDOCITEM2": [
{
"severity": "ERROR",
"message": "zBIACOLineDFF value is required."
}
]
},
"Exit Criteria": {
"PNDOCITEM2": [
{
"severity": "ERROR",
"message": "CHLI_Glob_Seg_Char_1 value is required."
}
]
}
},
"Approval": {
"SequenceNumber": "30”,
"StatusName": "Approval",
"StatusCode": "8",
"Entry Criteria": {
"General Information": [
{
"severity": “WARNING",
"message": “Priority value is required."
}
]
},
"Exit Criteria": {}
},
"Structure Lifecycle Phase Inconsistency Validation": {
"AuditItem-Parent": [
{
"Message": "Item AuditItem-Child cannot be in a lower lifecycle phase than the parent item.",
"Severity": "Error"
}
]
}
}
}