Stop splitting milestone titles on commas in work items REST API
What does this MR do and why?
Stop splitting milestone titles on commas in work items REST API
Milestone titles can contain commas, so splitting the milestone_title filter on commas turned a title like "September 16, 2026" into two titles that match nothing.
Passing several milestone titles as one comma-separated value (milestone_title=a,b) no longer works. Send them as an array instead (milestone_title[]=a&milestone_title[]=b), which is what the work items list UI already does when you add more than one Milestone token. Blank values are still ignored and surrounding whitespace is still trimmed.
References
Screenshots or screen recordings
Not provided
How to set up and validate locally
-
Enable the
work_item_rest_apiandwork_item_rest_api_frontend_usersfeature flags -
In the same Rails console, create a milestone with a comma in its title and assign it to an open work item. Note the project ID and work item ID it prints, since the curl calls below use them.
project = Project.find_by_full_path('flightjs/Flight') milestone = project.milestones.create!(title: 'September 16, 2026') issue = project.issues.opened.first issue.update!(milestone: milestone) [project.id, issue.id] -
Open
http://127.0.0.1:3000/flightjs/Flight/-/work_items, filter by State Open and MilestoneSeptember 16, 2026, and confirm the assigned work item shows up. -
Call the REST endpoint with a personal access token that has the
read_apiscope, and confirm it returns only the assigned work item ID:curl --globoff --header "PRIVATE-TOKEN: <your_access_token>" \ --url "http://127.0.0.1:3000/api/v4/projects/<project_id>/-/work_items?state=opened&milestone_title[]=September%2016%2C%202026" \ | jq 'map(.id)' -
Call the negated filter and confirm the work item is excluded (the command prints
false):curl --globoff --header "PRIVATE-TOKEN: <your_access_token>" \ --url "http://127.0.0.1:3000/api/v4/projects/<project_id>/-/work_items?state=opened&per_page=100¬[milestone_title][]=September%2016%2C%202026" \ | jq 'map(.id) | index(<work_item_id>) != null' -
Optional: check out
masterand repeat steps 3 to 5 to see the bug. The UI shows "No results found", the first curl call returns[], and the negated call printstruebecause the work item is not excluded.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.