How to pre-fill "labels" when opening merge_request url with query parameters

Hey there !

I’m constructing some url that directly open the “create merge request view”. I can give many parameters, such as the source_branch , target_branch , title , description , assignee , force_remove_source_branch … but I can’t find any way to set a list of labels . I tried with comma separated values, a json… url encoded… nothing is working so far.

I was also unable to find any documentation about which parameter can be sent in those query parameters. If any of my three question could be answered, I would be so happy !

  • What’s the expected parameter/format for labels when using an url for merge request creation ?
  • Is there any exhaustive documentation of those query parameters ? I was unable to find it.
  • Where is the source code where gitlab reads those parameters ? I could then check if it is possible to set the label :slight_smile: Maybe this is not supported, and I’m just loosing my team trying to set them !

Thanks for reading !

Hey @BertrandM!

Have you checked the MR API documentation?

1 Like

Yep !

I can actually set the label by calling the api, with comma-separated-labels as an input. I just can’t do that with the url and query parameters :confused:

Hey - for anybody finding this after all this time,

when using the URL to fill a MR you can add the labels using the commands in the description. If you have a label Bug you can put a line /label ~Bug into your description. In the URL that might look like this: &merge_request%5Bdescription%5D=stuff%0A%0A%2Flabel%20~Bug

1 Like