Forum Discussion

alnhk's avatar
alnhk
Copper Contributor
Aug 06, 2021

Migrating the scripts to MS Teams

we were using slack for more than 3 yrs, suddenly, our organization tells us to stop using slack and start using MS Teams. So, we had to migrate all the alerts from slacks to MS teams including notifications sent from jenkins. 

 

Having hard time to understand the https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL, where , currently, from jenkins to slack, we have this below payload that will be sent to slack webhook using CURL command (payload=${payload_attachments}, where, incase of the build failure, the "action" message is notified to slack with "Retry" or "Investigate" the build (if "Retry" clicked, the build is restarted on jenkins), it is working currently, however, any help with converting to MS teams is appreciated,

 

Payload_attachments="[{   \"fallback\": \"You are unable to retry the build\",   \"callback_id\": \"retry_build\",   \"attachment_type\": \"default\",   \"actions\": [
    {
      \"name\": \"retry\",
      \"text\": \"Retry Build\",
      \"type\": \"button\",
      \"value\": \"${BUILD_LINK}\",
      \"style\": \"primary\"
    },
    {
      \"name\": \"investigate\",
      \"text\": \"Investigate\",
      \"type\": \"button\",
      \"value\": \"${BUILD_LINK}\"
    }   ]}]"

 

 

1 Reply