Using REST on RTC, how do you query for a null or empty or unassigned field? What is the syntax?
Trying to create a REST query for RTC and return all workItems where the "foundIn" field is null / empty / unassigned.
What is the syntax of the REST URL for querying on a field that was never set by the user? With other REST tools, it's "is Null" or "is Empty" |
One answer
Hello Glenn,
you may use Firefox and Firebug - Net tab
Run a new / unsaved query with the params you need,
in Firebug, locate the call POST IQueryRestService#getResult()
check the Post tab and locate the Json values we pass:
jsonExpression:
{"operator":"AND","attributeExpressions":[{"attributeId":"foundIn","operator":"is not","values":["","_kRe6II6GEeOuIeSMwSQQhw"
],"variables":[]}],"termExpressions":[],"similarityExpressions":[]}
Assuming that value
_kRe6II6GEeOuIeSMwSQQhw
correspond to "Unassigned"
(I would rather use OSLC - https://jazz.net/wiki/bin/view/Main/WorkItemAPIsForOSLCCM20)
Hope it helps,
Eric
Comments
Glenn Henderson
commented Oct 17 '14, 8:00 a.m.
"Unassigned" is a null / empty entry. The JsonExpression for an "unassigned" (null) entry is value: [""]. When putting [foundId=''] (single quotes) into the REST URL, RTC responds with
Double Posting - But couldn't find how to delete this.
Glenn,
k - re-tested:
_kRe6II6GEeOuIeSMwSQQhw is the internal value of "None"
"" is for "Unassigned"
The expected syntax of the JsonExpression is not [foundId='']
The syntax of the JsonExpression we pass from the WebUI to the server is:
{"attributeExpressions":[{"attributeId":"foundIn","operator":"is","values":[""],"variables":[]}],"termExpressions":[],"similarityExpressions":[],"operator":"AND"}
Eric
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.