Filtering issues by type, assignee, status
i want to filter all the issues with type, assignee, status of the issues for pagination process so that i will get the paginated issues with filtered values by getting the response, but i cant get the desried output,
###baseUrl=https://{name}/api
`${baseUrl}/admin/projects/${projectKey}/issues?fields=id,idReadable,project(name),description,summary,customFields(name,value(name,minutes)),reporter(created,login),created&customFields=Assignee&customFields=Priority&customFields=Fix in Version&customFields=Status&customFields=Type&customFields=Total Dev Estimation&customFields=Estimation&customFields=Total Spent time&customFields=Billable Month&customFields=Due Date&$skip=0&$top=100001`
here i cant use the query key to filter by desired options,
'${baseUrl}/issues?query=project:+{${projectKey}}%20type:${formatType}%20status:${formatStatus}%20for:${formatAssignee}&fields=id,idReadable,project(name),description,summary,customFields(name,value(name,minutes)),reporter(created,login),created&customFields=Assignee&customFields=Priority&customFields=Fix in Version&customFields=Status&customFields=Type&customFields=Total Dev Estimation&customFields=Estimation&customFields=Total Spent time&customFields=Billable Month&customFields=Due Date&$skip=${skip}&$top=${limit}`
here i can use query key but it is not working with certain name types in the assignee names with spaces in it like it works with firstname.lastname but not with firstname lastname
Please sign in to leave a comment.
Hello,
I'm Sergey from the YouTrack team.
The query parameter with issue search syntax works exclusively for the api/issues endpoint. Using it elsewhere, like admin/projects, won't produce the desired results. Also, it filters issues for which data is returned; It doesn't filter the returned data itself.
This isn't valid usage and won't work. Please check out this example to see how to retrieve issue values. Once you have all the values, you can post-process the data for specific fields.
This behaves just like when you search in the UI. It's best to create a query in the UI that works and then use it in your REST API. You can check the Search Query Reference for assistance.
Feel free to reach out if you have any questions!
/issues?query=in: {78-155}%20type: Bug&fields=id,idReadable,project(name),description,summary,customFields(name,value(name,minutes)),reporter(created,login),created&customFields=Assignee&customFields=Priority&customFields=Fix in Version&customFields=Status&customFields=Type&customFields=Total Dev Estimation&customFields=Estimation&customFields=Total Spent time&customFields=Billable Month&customFields=Due Date&$skip=0&$top=10
{
"error": "invalid_query",
"error_description": "Can't parse search query, please check and update query syntax",
"error_developer_message": "Can't parse search query",
"error_field": "query",
"error_children": [
{
"error": "The value \"78-155\" isn't used for the project field.",
"error_description": ""
}
]
}
can you help me to filter the issues and paginate them while fetching
Im talking about the rest api filtering and not ui filtering..
Thanks for your response.
The REST API query syntax is the same as the UI's. As the error suggests, you used invalid query syntax, so it doesn't work. Also, as mentioned in my initial response, usages like `customFields=Status` are also incorrect and don't work. Please review my first response and update your request accordingly.