Discussions

Ask a Question
Back to All

WorkOrderCost.Items.TypeId Not filtering as Expected

When trying to get Work Order Cost Items, I only want the TypeId = 'Cost'. But running the below, I'm still getting all items (Cost and ServiceFees).

wo_url = base_url+'api/v1/query/WorkOrderCost'

wo_query = {
'QueryExpression': {
'Criteria': {
'Conditions': [
{
'PropertyName': 'Id',
'Operator': 'Equal',
'Values': [1149214]
},
{
'PropertyName': 'Items.TypeId',
'Operator': 'Equal',
'Values': ['Cost']
}
],
'FilterOperator': 'And'
},
'Distinct': True,
'PropertySet': {'Properties': ['Id', 'BillingAccount.DisplayAs', 'CostState', 'Items.*']}
}
}

wo_response = requests.post(wo_url, headers=headers, data=json.dumps(wo_query))

The resulting json data still includes ServiceFee items. Thoughts?