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

How to filter work item by state name using Reportable REST API

How to filter work item by state name using Reportable REST API

So far, I have only been able to filter by the State id:

https:// <server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem[state/name='Approved']/(id|state/name)

 

Is there different syntax I can use to query by State name?  If not, once the States are defined for a work item type, will the id's always be static at that point?

0 votes

Comments

The question field is playing havok with my URL formatting:

So far, I have only been able to filter by the State id:

https:// <server>:<port>/ccm/rpt/repository/workitem?fields=workitem/workItem[state/name='Approved']/(id|state/name)

 

Is there different syntax I can use to query by State name?  If not, once the States are defined for a work item type, will the id's always be static at that point?

The following gives an error "CRRED8022E: Non Queryable Field: state/name":

  

 Trying to list the URL again: 

  

    This is what doesn't work:

partial URL: fields=workitem/workItem[state/name='Approved']/(id|state/name)
 


Accepted answer

Permanent link
As the error message says, state/name is not queryable, so you can't filter on it.  The state IDs are static, so you could filter on that instead.
Michael Taylor selected this answer as the correct answer

2 votes

Comments

Thanks.  It's wierd that it lets you filter on state name if you do the filtering at the next lowest level on state.  I guess we'll just stick with the ID then.

Hi Alanna,

This works for me:
fields=workitem/workItem[projectArea/name='development' and type/id='defect' and state/id='bugzillaWorkflow.state.s9']/(id|summary|state/name)

but some state id's are in the form of 's2', 's3' etc

so if I try to run the below query for 's2':
fields=workitem/workItem[projectArea/name='development' and type/id='defect' and state/id='s2']/(id|summary|state/name)

It gives me a link to the next 100 but doesn't display any results. Any idea why? or how to resolve this?

Thanks,
Binoy

Binoy, for those 's' ids, use just the number: state/id='2'.

1 vote

Unbelievable! WOW! Thanks so much. Not sure why I didn't think of it. :)

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
× 10,954

Question asked: Jun 24 '13, 1:19 p.m.

Question was seen: 5,514 times

Last updated: May 07 '15, 2:49 p.m.

Confirmation Cancel Confirm