WIQL performs '+' operation inside where condition

Giannini Marco 0 Reputation points
2023-05-02T09:46:22.06+00:00
I need to retrieve work item using WIQL by REST API.
In detail I have work item type bug with the custom fields named custom.CompletedWork_1, custom.CompletedWork_2 and custom.CompletedWork_3.

Now I would like to get all the work items bug where the sum of the three fields custom.CompletedWork_1, custom.CompletedWork_2 and custom.CompletedWork_3 is different from the value of ther field Microsoft.VSTS.Scheduling.CompletedWork.

My idea is to perform a query by WIQL like this:

SELECT
        [System.Id],
        [System.WorkItemType]
FROM workitems
WHERE
        [System.TeamProject] = @project AND
        [System.WorkItemType] = 'BUG' AND
        ([custom.CompletedWork_1] + [custom.CompletedWork_2] + [custom.CompletedWork_3] <> [Microsoft.VSTS.Scheduling.CompletedWork])
		
but it doesn't work, I get the error '*Expecting comparison operator. The error is caused by «+».*'

Please can someone tell me which is the correct sintax to use into the where condition to get that the desidered workitems?

thanks in advance 		
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,102 questions
0 comments No comments
{count} votes