基于特定于TITLE(system.title)的搜索API [英] Search API based on specific to TITLE(system.title)
问题描述
https://almsearch.dev.azure.com/ $ {organization}/$ {project}/_ apis/search/workitemsearchresults?api-version = 5.1-preview.1
https://almsearch.dev.azure.com/${organization}/${project}/_apis/search/workitemsearchresults?api-version=5.1-preview.1
HTTP请求:
Content: {
"searchText": "${search}",
"$skip": 0,
"$top": 100,
"filters": {
"System.WorkItemType": [
"Issue"
],
"System.State": [
"Doing",
"To Do"
]
},
"$orderBy": [
{
"field": "system.id",
"sortOrder": "ASC"
}
],
"includeFacets": false
}
这在整个板上进行搜索,有没有一种方法可以添加过滤器以仅搜索title(system.title)本身,我尝试添加过滤器system.title无效
this searching the whole board, is there a way to add a filter just to search on title(system.title) itself, i have tried adding the filter system.title it doesnt work
场景:如果我想从REST API中搜索"ABC",即使在故事的描述或故事的讨论中存在"ABC",它也会返回结果....所以有一种搜索和返回的方法结果仅基于标题而不是其他任何内容
Scenario: if i want to search "ABC" from REST API it is returning the result even if "ABC" exists in description of the story or discussion of the story....so is there a way to search and return the results just based on title and not anything else
推荐答案
You can use a work item query with wiql Wiql - Query By Wiql
Wiql示例:
SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = 'ProjectName'
AND [System.Title] CONTAINS 'Search Text' ORDER BY [System.Id]
wiql的指导:工作项查询语言(WIQL)的语法
这篇关于基于特定于TITLE(system.title)的搜索API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!