azure-devops-python-api
azure-devops-python-api copied to clipboard
Fetch work item search results: usage of top and changedDate
Hey there,
am trying to find matches for some keywords with fetch_work_item_search_results. Param top within WorkItemSearchRequest is limited to max. 1000, does this mean they're max. 1000 results that can be returned or max. 1000 work items that are even checked?
I'd also like to apply a filter to check only for the work items from the past week, but when adding the filter with System.ChangedDate following exception is thrown:
azure.devops.exceptions.AzureDevOpsServiceError: Unknown filter [System.ChangedDate] found.. Which filter could be used instead or is there no possibility to filter a specific timeframe without using WIQL?
sort_option = SortOption(field='system.id', sort_order='ASC')
for keyword in test_keywords:
search_request = WorkItemSearchRequest(
#filters = { 'System.ChangedDate': [ '@Today-7' ]},
search_text = keyword,
order_by = [sort_option],
skip = 0,
top = 1000,
include_facets = False
)
work_item_search_response = search_client.fetch_work_item_search_results(search_request, project=project_name)