Importing automation rule from Jira server to cloud error give error| codebarrel.automation.rulecomponent.jira.action.slack.SlackNotificationActionConfig["webhookUrl"
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Importing Automation JSON from Server to cloud gives below error:
1
Error parsing provided JSON. Please ensure it was created using 'Export rules' previously. If the problem persists please contact Atlassian support! 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.slack.SlackNotificationActionConfig["webhookUrl"])
Diagnosis
The error points to the automation rule component SlackNotification, which holds WebhookURL; the component in the automation JSON might not be in the format structure desired on the Jira cloud automation rule.
Cause
Jira cloud and server follows different structure or format in JSON for components.This led to conflict when importing the automation rules from different platforms. We are working on the improvement of this feature on the feature request below :
The Jira server follows the structure for Slack notifications as below :
1
2
3
4
5
6
7
8
9
"type": "slack.notification",
"value": {
"webhookUrl": {
"key": "https://hooks.slack.com/services/XXXXXX/XXXXXoBf"
},
"body": "You were mentioned in '{{issue.issuetype.name}}'\n*<https://jira.XXXXX/browse/{{issue.key}}|{{issue.key}}>*\n{{issue.summary}}\n\n{{issue.comments.last.body}}",
"channel": "@TEST",
"automationSender": true
}
Whilst Jira cloud expects the slack notification in the below format in JSON:
1
2
3
4
5
6
7
"type": "slack.notification",
"value": {
"webhookUrl": "https://hooks.slack.com/services/XXXXXX/XXXXXoBf",
"body": "You were mentioned in '{{issue.issuetype.name}}'\n*<https://jira.XXXXX/browse/{{issue.key}}|{{issue.key}}>*\n{{issue.summary}}\n\n{{issue.comments.last.body}}",
"channel": "@TEST",
"automationSender": true
}
Solution
Locate the component "webhook URL" in the JSON file and replace the structure as below:
1
2
3
4
5
6
7
"type": "slack.notification",
"value": {
"webhookUrl": "https://hooks.slack.com/services/XXXXXX/XXXXXoBf",
"body": "You were mentioned in '{{issue.issuetype.name}}'\n*<https://jira.XXXXX/browse/{{issue.key}}|{{issue.key}}>*\n{{issue.summary}}\n\n{{issue.comments.last.body}}",
"channel": "@TEST",
"automationSender": true
}
Please ensure to have values of webhookUrl, body, channel and automationSender as per your existing values from Jira server Json.
Was this helpful?