3

I am developing a service hook extension for Azure DevOps that is loosely based on the sample provided on https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-service-hook?view=azure-devops

I cannot find any documentation on the available actions. For example, the sample provides a sample consumer with an action of publishEvent but there is no reference material on this.

Could someone please point me toward any reference documentation that might exist?

Tobias Theel
  • 3,088
  • 2
  • 25
  • 45
  • Maybe [this document](https://github.com/microsoft/azure-devops-extension-api/tree/master/src/ServiceHooks) can make some help for you? Feel free to let me know if it's not helpful :) – LoLance Dec 06 '19 at 10:00
  • I don't believe this was what I needed. How does one, for example, make a HTTP POST with a custom content as the action on a serviceHook event? – user3475441 Dec 11 '19 at 10:51
  • @LanceLi-MSFT i fear this is not really helpful. I cannot find any documentation about custom service hooks, beside the sample from the question. – Tobias Theel Jan 06 '20 at 13:30

1 Answers1

1

It's only supported to send standard event payload with custom service hooks for now. In the sample, you can see the action defined as below:

        "actions": [
            {
                "id": "performAction",
                "name": "Perform action",
                "description": "Posts a standard event payload",
                "supportedEventTypes": [
                    "git.push",
                    "git.pullrequest.created",
                    "git.pullrequest.updated"
                ],
                "publishEvent": {
                    "url": "{{{url}}}",
                    "resourceDetailsToSend": "all",
                    "messagesToSend": "all",
                    "detailedMessagesToSend": "all"
                }
            }
        ]

With this setting, it will send all the payload about the trigger event to the URL you configured. And you can configure how much of the information to send:

resourceDetailsToSend - all, minimal, none
messagesToSend - all, text, html, markdown, none
detailedMessagesToSend - all, text, html, markdown, none
Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • Just to clarify again - it is not possible to customize the body send in any form? And it is also not possible to trigger any kind of custom script? – Tobias Theel Jan 07 '20 at 14:38
  • @TobiasTheel Yes, it's not supported. – Eddie Chen - MSFT Jan 08 '20 at 00:27
  • hi @EddieChen-MSFT can you answer this question? hi, can you answer this question Starian? https://stackoverflow.com/questions/64546693/azure-devops-running-two-builds-sequentially –  Oct 27 '20 at 00:21