Discussions

Ask a Question
Back to all

How to add assignment information when creating workorder use WoCreateCommand

When I try to create workorder via WoCreateCommand

{
    "Command": {
        "WorkOrder": {
            "Items": [
                {
                    "Asset": {
                        "Id": 9458
                    },
                    "Task": {
                        "Id": 35204
                    },
                    "Assignment": {
                        "Id": 0
                    },
                    "Comment": "[TEST ONLY] Air Conditioning generate too much noise"
                }
            ],
            "TypeCategory": 4,
            "SubType": {
                "Id": 265
            },
            "Customer": {
                "Id": 2
            },
        },
        "ComputeSchedule": true
    }
}

I got error: Priority 'Normal' is escalated; assignment is required

This is because the specified Task is configured will isEmergency WoPriority.

Can someone show me sample code how to add assignment information into the request body?

Thank you so much