Integrating Dynatrace with Jenkins for Deployment Events (API v2 Compatibility)

Hi everyone,

I’m working on integrating Dynatrace with Jenkins to send deployment events. I’ve found two resources:

  • Official documentation mentioning a plugin: Docs link
  • Blog post referencing a library: Blog link

Both resources use the Events API v1 (POST) with JSON format.

My question: can I use either the plugin or library approach with the updated Events API v2 format?

Any insights on this or recommendations for v2 integration would be greatly appreciated!

Hi,

You can use Events API v2 - POST an event.

Best regards

You could just send the events through curl

stage('Send Event') {
            steps {
                script {
                    def response = sh(
                        script: """
                            curl -X POST \
                            -H "Content-Type: application/json" \
                            -H "Authorization: Api-Token ${AUTH_TOKEN}" \
                            -d '${PAYLOAD}' \
                            ${DT_URL}
                        """,
                        returnStdout: true
                    ).trim()
                    echo "Response: ${response}"
                }
            }
        }

I wrote a PR for the Jenkins integration requesting the update to events v2, maybe you can reuse parts of it.

Hello, thanks for sharing the documentation.

I’m looking for some specific guide.

Greetings

Hello thank you very much.

Thats what Im looking for.
I’ll try to reuse your code and come back to tell you how it turned out.

Greetings