It's all about the answers!

Ask a question

How to include "NULL" object in query or filter


Michael Toole (31168) | asked Aug 13 '14, 8:00 a.m.
edited Aug 13 '14, 3:16 p.m.
  I am in RPE 1.2.11

I am doing a query and or filter on “Resolution” field

If the state is in a specific type the resolution field shows as a “-“ meaning nothing is set.

 Example:

if the workitem is in a state of submitted there is no resolution... 

when you look at the results from a query the resolution field shows a "-"

If you look at the oslc the resolution field is completely blank

How do I include those that are blank in a filter? Basically include null?

ive tried resolution/name != "Withdrawn" (this returns all the items that match that except the ones that are null...

Or, can you generate a javascript to query it? 

One answer



permanent link
Subramanya Prasad Pilar (4.6k16) | answered Aug 13 '14, 8:32 a.m.
If you are doing this though Filter Editor in RPE, you can check "XHTML Input" option and then use
resolution == "<o:p> </o:p>"

The XHTML value for the attribute selected will be returned when you check this option.

Comments
Michael Toole commented Aug 13 '14, 9:02 a.m. | edited Aug 13 '14, 9:03 a.m.

EDIT: I just realized that this put in the <o:p> part... 


wouldnt you use name instead of resolution? 
and I tried it and it still didnt work


i tried up loading a pic but i dont have a high enough reputation which is stupid... here is a dropbox link


Subramanya Prasad Pilar commented Aug 13 '14, 1:02 p.m. | edited Aug 13 '14, 1:05 p.m.

Yes. That is what I meant. Now could you please try these?
1. Right click on the datasource and select Preview data, provide the URL and check what value is returned by REST API (make sure if it is "<o:p> </o:p>") (Or do a GET for the data source URL and check what value is returned)
2. Click "Test script" and make sure that your condition evaluates to true


Michael Toole commented Aug 13 '14, 3:04 p.m.

 im kinda lost now... 

what url should i use?


Subramanya Prasad Pilar commented Aug 13 '14, 3:51 p.m.

REST URL - Something like https://server:9443/ccm/rpt/repository/workitem


Michael Toole commented Aug 14 '14, 9:43 a.m. | edited Aug 14 '14, 9:45 a.m.

 ok so i FINALLY figured out how to do that.. wow that will save alot of time LOL


Ok so here is my issue now with this... 
-<workItem><id>23656</id></workItem>-
<workItem><id>23657</id>-
<resolution>
<id>amdws.workflow.defect.resolution.r7</id>
<name>Govt Do Not Fix</name>
</resolution>
</workItem>

Notice how 23656 doesn't have an id?  


Subramanya Prasad Pilar commented Aug 15 '14, 2:42 p.m.

I hope you were able to do what you were looking for. You can also use javascript / string length function to check if len > 0 or not.

showing 5 of 6 show 1 more comments

Your answer


Register or 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.