Thanks for the report @manjupri . The checkbox on the merge request display is intended to modify the action of the "merge" button on that page only.
If you "Edit" the merge request, you'll see there's a checkbox there which will take effect globally - including in the API. You can also pass the desired action along in the API call itself, overriding that global setting.
The UI for this could definitely be improved to make it less confusing though, so let's keep this issue open.
@jramsay - I think this might belong in your group - https://gitlab.my.salesforce.com/00161000005cxCt Would like to get an update on when this might be addressed. Their management is looking for timeline on when they can be fixed or not fixed so that they can communicate to their customers internally and take needed action.
If a user edits an MR and ticks Delete source branch when merge request is accepted. the source branch will be deleted after a PUT to /merge. (Confirmed this on gitlab.com)
If a user selects Delete source branch on the merge widget the state doesn't get saved (as expected because those tick boxes are actions to be performed after pressing the Merge button), and then the source branch will not be deleted after a PUT to /merge
That makes sense to me @jay_mccure - it also seems like it's not a common situation. We can always revisit if those toggles should persist over the API if this comes up in the future.