How do I querry if fields are NULL or not set?
I am using the restful web interface into a 4.0 version of RTC. I can do many queries for specific =, <, or > but I am unable to find a way to search for NULL values. I would like to get results for when a workitem does not have a resolutionDate, or if it does have a resolutionDate so that I could get reports of all resolved or unresolved work items.
This same unresolved question appears at http://www.ibm.com/developerworks/forums/thread.jspa?threadID=467391&start=15&tstart=0.
This same unresolved question appears at http://www.ibm.com/developerworks/forums/thread.jspa?threadID=467391&start=15&tstart=0.
3 answers
Hi Donald,
Some attributes have an "Unassigned" option:
Resolution date doesn't have that option. However, if you're simply looking for a list of unresolved or resolved work items, the Status can be queried for Unresolved or Resolved:
Some attributes have an "Unassigned" option:
Resolution date doesn't have that option. However, if you're simply looking for a list of unresolved or resolved work items, the Status can be queried for Unresolved or Resolved:
Comments
Is there a valid answer to this question? I'm tasked with the same issue, trying to create a REST based query where the field / entry is null.
The only way to do this, that I can see, is either:
state/id=open state1id or state/id=open state2id
OR
state/id!=closedState1id and state/id!=closedState2id
So this is stinky. But don't worry, it gets stinkier!
If you need your application to be dynamic to support a variety of projects with a variety of states... or don't want to worry about maintaining the list of open or closed state ids... then you can programatically get the state ids of the states in the closed group, like so:
1) Query the project area for work item type ids (using OSLC):
/ccm/oslc/types/_ProjectAreaId
2) Iteratively query each of the work item shapes for work items you're interested in to find the workflow IDs:
/ccm/oslc/contexts/_ProjectAreaId/shapes/workitems/workItemId (from step 1)
Note: This query requires OSLC version 2.0, so you must set a header: "OSLC-Core-Version: 2.0"
3) Iteratively query the workflow IDs found in step 2 to determine available states, and state groups:
/ccm/oslc/workflows/_ProjectAreaId/states/workFlowId (from step 2).
It sure would be nice if there was an easier way. Normally I would never resurrect an old post... but I had this question and could not see another answer in the forum... so had to go and painfully figure this out.