core API - how to query for all defects in project (scope) and return certain fields

32 views
Skip to first unread message

Lars Nordin

unread,
Jan 24, 2012, 4:37:32 PM1/24/12
to version...@googlegroups.com

I’ve tried using URL “rest-1.v1/Data/Defect?sel=Number&find=my-project-name&findin=Scope.Name” but this works for some projects and doesn’t for others.

 

I’d rather query this way then doing a multiple step query of:

-  getting the OID for a scope

- listing all defects for that scope OID ; by using “rest-1.v1/Data/Scope/10001/Workitems:Defect”

- then querying each defect to see if it has the properties that I am searching for

ibuchanan

unread,
Jan 24, 2012, 6:03:03 PM1/24/12
to VersionOne-dev
Lars,

The "find" parameter here is the same as the search functionality in
our application, which leverages MS SQL Full Text Search. This means
there are some limitations to the words you can use to find things.
For more details see this Knowledgebase article:
http://community.versionone.com/KnowledgeBase/FAQs/Q11445.aspx

Regardless of stop-word limitations, that kind of query is rather
inefficient if you already know the actual name of the project. I
suggest using the "where" parameter for strong matching:
rest-1.v1/data/Defect?sel=Number&where=Scope.Name='my-project-
name'&page=5,0

Hope that helps,
Ian

Lars Nordin

unread,
Jan 25, 2012, 8:19:35 AM1/25/12
to version...@googlegroups.com
Arg, I should have re-read the query documentation again - that is exactly what I am looking for.

You are correct about the project name - I previously used the find and findin syntax for a situation where I didn't know what project the defects were in (and was matching part of the field).

Thanks!

Reply all
Reply to author
Forward
0 new messages