Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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"

0 votes



One answer

Permanent link
 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

0 votes

Comments

"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

ERROR 500: CRRED0105E:  Unsupported type name: com.ibm.team.workitem.Deliverable

There should be some secret keyword for searching for null field values.  I would hate to have to reverse the logic and "is not" all of the possible values.

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

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,097

Question asked: Oct 16 '14, 7:18 p.m.

Question was seen: 8,049 times

Last updated: Oct 17 '14, 8:30 a.m.

Confirmation Cancel Confirm