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

Can't set MS Teams notification block #16793

Closed
deweil opened this issue Jan 21, 2025 · 2 comments
Closed

Can't set MS Teams notification block #16793

deweil opened this issue Jan 21, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@deweil
Copy link

deweil commented Jan 21, 2025

Bug summary

Bug summary

There is an bug in

def block_initialization(self) -> None:

which does not allow to insert MSTeams webhook urls and raise an pydantic validation error

pydantic_core._pydantic_core.ValidationError: 1 validation error for MicrosoftTeamsWebhook
  Value error, Invalid Microsoft Teams Workflow URL provided. [type=value_error, input_value={'url': 'https://team-name.we...ge': True, 'wrap': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/value_error

Looks like the wrong apprise plugin apprise.plugins.workflows import NotifyWorkflows is used instead of from apprise.plugins.msteams import NotifyMSTeams.

Also

NotifyWorkflows.parse_native_url(self.url.get_secret_value()), # pyright: ignore[reportUnknownMemberType] incomplete type hints in apprise

needs to be parse_url instead of parse_native_url

Working example

from apprise.plugins.msteams import NotifyMSTeams

webhook_url = "https://team-name.webhook.office.com/webhookb2/abcdefgf8-2f4b-4eca-8f61-225c83db1967@abcdefg2-5a99-4849-8efc-c9e78d28e57d/IncomingWebhook/291289f63a8abd3593e834af4d79f9fe/a2329f43-0ffb-46ab-948b-c9abdad9d643"

NotifyMSTeams.parse_url(webhook_url)

Version info

Version:             3.1.7
API version:         0.8.4
Python version:      3.9.21
Git commit:          c05ffa6d
Built:               Mon, Dec 16, 2024 10:06 AM
OS/Arch:             linux/x86_64
Profile:             ephemeral
Server type:         server
Pydantic version:    2.10.3

Additional context

No response

@deweil deweil added the bug Something isn't working label Jan 21, 2025
@zzstoatzz
Copy link
Collaborator

hi @deweil - i believe this was an intentional change because of impending changes from Microsoft's end. Is it possible you're using the old version of things?

@deweil
Copy link
Author

deweil commented Jan 24, 2025

Hi @zzstoatzz after checking the linked issue I can switch to the workflow based approach.
It wasn't clear to me that the "Incoming Webhook" does not work with the Teams block.

@deweil deweil closed this as completed Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants