DEV Community

Anand Kadhir
Anand Kadhir

Posted on

2 1

Triggering Jenkins build through MS Teams

Is there any way to trigger a JENKINS build through Microsoft Teams?

I am aware of using incoming webhooks to get notifications from JENKINS, but triggering a build I have no idea.

If anyone is using Outgoing Webhooks (or something else) to trigger JENKINS build, can you please explain how to use that?
(I am having parameterized JENKINS build job, which can be remotely triggered)

Top comments (5)

Collapse
 
danielltw profile image
Daniel Leong 🇸🇬

You could work with Jenkins API endpoint. Create your own hook.

crumb=$(curl -u "$USER:$JENKINS_API_KEY" -s 'http://$HOST/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
curl -vg -u "$USER:$JENKINS_API_KEY" --data-urlencode json=$DATA -H "$crumb" "http://$HOST/job/$PROJECT_NAME/build?delay=0sec"

DATA="{\"parameter\":[{\"name\":\"GITHUB_BRANCH_HEAD_SHA\",\"value\":\"$GITHUB_SHA\"},{\"name\":\"GITHUB_BRANCH_NAME\",\"value\":\"$BRANCH\"},{\"name\":\"BUILD_NUMBER\",\"value\":\"$GITHUB_SHA\"},{\"name\":\"ACTION_DESCRIPTION\",\"value\":\"$BRANCH
$GITHUB_SHA\"}]}"

Hope this help slightly.

Collapse
 
kadhireshan profile image
Anand Kadhir • Edited

Thanks Daniel. I will try to implement what you have mentioned.

Collapse
 
prashanth_gatram_150c413c profile image
Prashanth Gatram

did it work for you ?

Collapse
 
avinash_vemuri_d8f49c9760 profile image
Avinash Vemuri

Hi, I am trying to do something similar. I was wondering if you had any luck implementing this?

Thread Thread
 
prashanth_gatram_150c413c profile image
Prashanth Gatram

did you find any luck implementing the abv method ?

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay