Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on notification format in 5.0.0 with Adaptive Cards #366

Open
rdrgporto opened this issue Oct 17, 2024 · 2 comments
Open

Questions on notification format in 5.0.0 with Adaptive Cards #366

rdrgporto opened this issue Oct 17, 2024 · 2 comments

Comments

@rdrgporto
Copy link
Contributor

rdrgporto commented Oct 17, 2024

Hi,

We have updated the plugin to version 5.0.0 to use Microsoft Adaptive Cards. We have created a Workflow in Teams by using Webhook Template called Post to a channel when webhook required is a received:

Our previous configuration was as follows (here’s a simple example for when the build is a Success)::

post {
 success {
  withCredentials([string(credentialsId: "${env.MICROSOFT_TEAMS_CREDENTIAL}", variable: "WEBHOOK_URL")]) {
   office365ConnectorSend webhookUrl: "${env.WEBHOOK_URL}",
   message: "**Status**: Success  \n **Build**: ${env.BUILD_NUMBER}  \n **Commit**: ${env.GIT_COMMIT.take(7)}  \n **More info**: [Jenkins](${env.BUILD_URL})",
   color: '#58D68D'
  }
}

Image

With the new configuration (we’ve only added the adaptiveCards parameter)

post {
 success {
  withCredentials([string(credentialsId: "${env.MICROSOFT_TEAMS_CREDENTIAL}", variable: "WEBHOOK_URL")]) {
   office365ConnectorSend webhookUrl: "${env.WEBHOOK_URL}",
   message: "**Status**: Success  \n **Build**: ${env.BUILD_NUMBER}  \n **Commit**: ${env.GIT_COMMIT.take(7)}  \n **More info**: [Jenkins](${env.BUILD_URL})",
   color: '#58D68D',
   adaptiveCards: true
  }
}

Image

We have several doubts/questions about the new notification format:

  1. Does it make sense to display "Notification from node-app » main » master"? Isn't it redundant?
  2. Does it make sense to show the build in the title? Previously, it didn't appear there; we displayed it in the message instead.
  3. Is the color: parameter necessary? We've noticed that the color changes based on whether it's Success, Failure, etc.

Thanks in advance,

Regards

@movedoa
Copy link

movedoa commented Oct 22, 2024

Afaik color doesnt work anymore, the plugin uses color based on build status.
https://github.com/jenkinsci/office-365-connector-plugin/blob/master/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java#L40

You can set the status yourself:

...
message: "Foo",
status: "Success",
adaptiveCards: true
...

Although some seem missing, like "Aborted"

@rdrgporto
Copy link
Contributor Author

Afaik color doesnt work anymore, the plugin uses color based on build status. https://github.com/jenkinsci/office-365-connector-plugin/blob/master/src/main/java/jenkins/plugins/office365connector/model/adaptivecard/AdaptiveCard.java#L40

You can set the status yourself:

...
message: "Foo",
status: "Success",
adaptiveCards: true
...

Although some seem missing, like "Aborted"

Hi @movedoa

Yes, regarding the color, that’s what we were thinking. We understand that the use of that parameter should be removed and documentation should be updated to avoid confusion

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants