Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create an extension for branch policy? #174

Open
mesuttalebiacerpro opened this issue Oct 8, 2024 · 1 comment
Open

How to create an extension for branch policy? #174

mesuttalebiacerpro opened this issue Oct 8, 2024 · 1 comment

Comments

@mesuttalebiacerpro
Copy link

Hi There,

I want to create an extension for branch policies to check for Jira WorkItem link in description?

Or maybe force adding Jira WorkItem link in another field like what we use for WorkItemID?

any Suggestion? or is it possible at all?

@bryanbcook
Copy link

There is documentation on how to setup a custom pull request server. I've done something recently using the same concepts but using a C# Function App to handle the webhooks.

At a high-level:

  1. You define a "Custom Status" in your Branch Policy and give it a name like "jira/work-item". Set this status as required to ensure that all pull requests meet this requirement.
  2. You define a webhook that calls out to your function app.
  3. Your function app receives the details of the pull request in the webhook payload, and you perform your custom logic there. You post a custom status for "jira/work-item" back to your pull request to indicate the outcome of the check.

By default, the custom check appears like any other branch policy requirement. If you want to add custom drop-down options to that policy check, there is an example here that targets the fabricam/ci-service custom status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants