API requires object ID, but impossible to resolve IID to ID effectively
Closed
API requires object ID, but impossible to resolve IID to ID effectively
Created by: dmaslakov
My use case: webhook parses commit messages to find out merge request reference (!123
), then webhook needs author of merge request.
The problem here is 123
which is merge request IID, while API calls require ID.
To find IID of merge request I see the only way -- do iterate over all merge requests (using GET /projects/:id/merge_requests
). But this is far from being effective.
I propose the following options:
- Do not use ID in calls, because
GET /projects/:id/merge_request/:merge_request_id
already assumes the object under particular project and it's OK to identify merge request in scope of the project, i.e. use IID. Unfortunately it breaks backward compatibility. - Create new method that will resolve IID to ID and vice versa for any object type.
- Extend existing methods to take both IID and ID. For example, extend method
GET /projects/:id/merge_request/:merge_request_id
so that it accepts IID likeGET /projects/:id/merge_request/:merge_request_IID?local=true
.
Please register or sign in to reply