WIQL by REST API: check empty numeric fields into where condition

Giannini Marco 0 Reputation points
2023-05-02T08:58:36.3566667+00:00
I'm trying to get SELECT data from Work items via REST API using WIQL.
I need to get workitems that have a specific numeric field is not valued (null or empty), so I write a query like this:


	SELECT
		[System.Id],
		[System.WorkItemType],
		[custom.CompletedWork_1],
		[custom.CompletedWork_2],
		[custom.CompletedWork_3]
	FROM workitems
	WHERE
		[System.TeamProject] = @project AND
		[System.WorkItemType] = 'BUG' AND
		[Microsoft.VSTS.Scheduling.CompletedWork] IS NOT NULL
		
but it doesn't work, I get the error "*Expecting 'empty' after 'is not'*"

I have also tried substituting 'EMPTY' for 'NULL' and I get this error message '*Is Empty can only be used with history, long text and plaintext fields.*'

Please can someone help me out on how to resolve this error?
Thank you
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,078 questions
0 comments No comments
{count} votes