Error when importing Automation Rules from Server/DC with msteams.notification action
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Importing rules that were exported from Server that have Send Microsoft Teams message errors out with the below message:
Error: MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 15] (through reference chain: com.codebarrel.automation.rulecomponent.jira.action.msteams.MicrosoftTeamsNotificationActionConfig["webhookUrl"])
Environment
Jira Cloud
Diagnosis
N/A
Cause
There's a difference between the format used in DC/Server rules comparing to Cloud for the msteams.notification action.
Solution
The solution is to update the structure of the rule action for msgteams.notification. Below is a comparison on how it was and how it should be:
- Grab the webhookUrl from Server/DC and update it as teamsWorkflowURL in Cloud.
- Remove the webhookURL object and add it as teamsWorkflowURL inside value object.
Server/Data Center JSON:
"type": "msteams.notification",
"value": {
"webhookUrl": {
"key": "<<The value set in Webhook URL field>>"
},
"title": "<<Title>>",
"subTitle": "",
"imageUrl": "<<Image URL>>",
"body": "<<Message Body>>",
"includeIssueSummary": true
}
Cloud JSON:
"type": "msteams.notification",
"value": {
"teamsWorkflowURL": "<<The value set in Webhook URL field>>",
"title": "<<Title>>",
"subTitle": "",
"imageUrl": "<<Image URL>>",
"body": "<<Message Body>>",
"includeIssueSummary": true
}