Hi
I am trying to auto enable "custom merge check" on new repositories created. I cannot add it at Project level to make it inherit the check since I do not want to add this check to all repos under it. Please suggest me how to achieve it.
I was planning to write a event handler using RepositoryCreatedEvent and enable the check for the new project created in "Script Event Handlers". But not finding a way to retrieve the "custom merge check" in that. PLease let me know if there is better option.
Thanks for your help in advance.
Hi Roopa,
Did you have a look at the REST API? You should be able to achieve this by POSTing to:
/rest/projects/{projectKey}/settings/pull-requests/{scmId}
Please see the documentation for that endpoint:
Update the pull request merge strategy configuration for this project and SCM.
The authenticated user must have PROJECT_ADMIN permission for the context repository to call this resource.
Only the strategies provided will be enabled, the default must be set and included in the set of strategies.
Do note that this API is only available since 4.9.0.
I hope this helps!
Thank you Dick Wiggers.... But this is apparently not listing out the custom merge checks... I do not know how to access custom merge checks through APIs to get information about its id and other stuff.. Any information regarding this would be very helpful. Look forward to your response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.