Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Work Items with dc:description #140

Open
joycelynteo opened this issue Jun 9, 2021 · 6 comments
Open

Query Work Items with dc:description #140

joycelynteo opened this issue Jun 9, 2021 · 6 comments
Labels

Comments

@joycelynteo
Copy link

query_str = ('dc:type="defect"' and '"word" in dc:description')

Is there a way I can query work items that have a certain word in its description? Something like the line above. If it's not possible, is there a way to increase the query limit from 1000 because I would like more data for work items that have the word in the description.

@joycelynteo joycelynteo changed the title Query Work Items by description Query Work Items with dc:description Jun 9, 2021
@dixudx
Copy link
Owner

dixudx commented Jun 16, 2021

query_str = ('dc:type="defect"' and '"word" in dc:description')

It seems '"word" in dc:description' is not supported, refer to the query syntax for more details,

query      ::= (term (boolean_op term)*)+ modifiers
term       ::= (identifier operator)? value+ | (identifier "in")? in_val
operator   ::= "=" | "!=" | "<" | ">" | "<=" | ">="
boolean_op ::= "and"
modifiers  ::= sort?
sort       ::= "/sort" "=" identifier
identifier ::= word (":" word)?

Is there a way I can query work items that have a certain word in its description?

AFAIK, we can only filter those items after querying.

is there a way to increase the query limit from 1000

We can use sort to help sort top 1000 items and use dc:created to help filter later 1000 items and so on.

query_str = 'dc:type="defect" and oslc:orderBY="dc:created"'

Use the creating time of last item in the query results for later queries, such as,

query_str = 'dc:type="defect" and dc:created>="12-02-2019T18:42:30" and oslc:orderBY="dc:created"'

@joycelynteo
Copy link
Author

ah okay, thanks for your help!

@joycelynteo
Copy link
Author

joycelynteo commented Jun 17, 2021

image
/sort="dc:created" doesn't seem to work for me, is that an issue on my side? The picture above appears in the url in the error "requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:"

@joycelynteo joycelynteo reopened this Jun 17, 2021
@dixudx
Copy link
Owner

dixudx commented Jun 17, 2021

@joycelynteo Please try query_str = 'dc:type="defect" and oslc:orderBY="dc:created"'.

Let me know if this works.

@joycelynteo
Copy link
Author

image
It gives the same error

@dixudx
Copy link
Owner

dixudx commented Jun 18, 2021

@joycelynteo Please checkout branch query-order to see whether it works.

By default, the query results are sorted with descending order by last modified time. A new param order_by is added to method queryWorkitems. Possible value could be,

  • "-dc:modified": descending order by last modified time
  • "+dc:modified": assending order by last modified time
  • "-dc:created": descending order by created time
  • "+dc:created": assending order by created time
  • "-rtc_cm:resolved": descending order by resolved time
  • "+rtc_cm:resolved": assending order by resolved time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants