Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Feeding Jenkins deploy data to Compass events

hpatel21
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 1, 2023

Are there any instructions on recording Jenkins generated data as deployment events in Compass? My attempts to input these via REST API have been unsuccessful. I'm trying to add this within a component thats linked to a bitbucket cloud repo.

4 answers

2 votes
Andy Wong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 1, 2023

Hi @hpatel21 and @Phill Pafford

There is a way to send Jenkins build data via a curl command. Shoutout to @Dave Parrish _Atlassian_ for investigating this.

The pre-conditions are that there is a Github post-commit hook that runs the following script that triggers a Jenkins build.

export BUILD_START_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ')

echo "Starting Website build #{$BUILD_NUMBER} at ${BUILD_START_TIME}"
sleep 2s

export BUILD_FINISH_TIME=$(date -u +'%Y-%m-%dT%H:%M:%SZ')

curl \
--request POST \
--url https://<atlassian-site>.atlassian.net/gateway/api/compass/v1/events \
--user "${ATLASSIAN_API_CREDENTIALS}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"cloudId\": \"ca4d6d1f-c9de-431f-9a40-6682e1968a11\",
\"event\": {
\"build\": {
\"updateSequenceNumber\": ${BUILD_NUMBER},
\"displayName\": \"Website build ${BUILD_NUMBER}\",
\"description\": \"Build ${BUILD_NUMBER} of Website\",
\"url\": \"${BUILD_URL}\",
\"lastUpdated\": \"${BUILD_FINISH_TIME}\",
\"externalEventSourceId\": \"<your-jenkins-source-id>\",
\"buildProperties\": {
\"state\": \"SUCCESSFUL\",
\"pipeline\": {
\"pipelineId\": \"${BUILD_NUMBER}\",
\"url\": \"${BUILD_URL}\",
\"displayName\": \"Pipeline ${BUILD_NUMBER} of Website\"
},
\"startedAt\": \"${BUILD_START_TIME}\",
\"completedAt\": \"${BUILD_FINISH_TIME}\"
}
}
}
}"

echo "Finished Website build #{$BUILD_NUMBER} at ${BUILD_FINISH_TIME}" 
Phill Pafford August 1, 2023

Hi Andy,

 

I have the exact same curl command, the only thing that differs is the `externalEventSourceId` but all I ever get is this response, any chance you ran into this and have a solution to solve it?

NOTE: I did follow the graphql commands and created the custom event type

 

{

"errors": [

{

"type": "CREATE_EVENT_SOURCE_NOT_FOUND",

"message": "We could not create the event because the event source is not found. Please check that the external event source ID and the type of event being submitted match the event source.If a Forge App ID was used during event source creation, please also check you are using the same Forge App ID when accessing the event source."

}

]

}
Andy Wong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2023

HI Phill, is the external event source ID you added correct? It looks like the request is incorrect or potentially permissions are not available for that said external source ID.

Phill Pafford August 10, 2023

thanks Andy, I found my issue, I was using the ARN and not the static name I assign it

0 votes
Mark Rekveld - Marvelution
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 28, 2024

Hi all,

I'm Mark developer of the Jenkins Integration for Jira app, and I'm currently looking to expose the data collected by the app to other Atlassian tools as well, like Compass.

The future Compass app would be an addition to the Jira app and would allow a seemless integration where the configuration of the integration can be managed in Jira and Compass.

Let me know if you would like to be part of a beta group to get first access to the Compass app, drop me a mail at support@marvelution.com.

Cheers,
Mark

Marcel Rossouw May 28, 2024

Yes please!

Mark Rekveld - Marvelution
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 28, 2024

Noted @Marcel Rossouw please drop me a mail at support@marvelution.com so I can get in touch with you.

0 votes
hpatel21
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 2, 2023

Thanks, I was finally able to publish data calling the API using curl. The problem was with publishing to development environment instead of staging/production. Looks like development/testing environments are not supported out of the box.

Eric Chauvin May 28, 2024

yes, i have same trouble, we cannot view events published to development, so this tool is useless for now

0 votes
Phill Pafford June 1, 2023

I'm also looking for this as well. I did see some related repos that are interesting

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events