MismatchedInputException in automation JSON import from Data Center to Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
While attempting to migrate Automation rules from Jira Data Center to Jira Cloud, users may receive the following error message, despite following the steps outlined in this guide:
Error: MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object
value (token `JsonToken.START_OBJECT`) at (ByteArrayInputStream); line: 1, column: 181 (through reference chain: com.codebarrel.automation.rulecomponent.jira.action.outgoingwebhook.OutgoingWebhookActionConfig"headers">java.util.ArrayList0>
com.codebarrel.automation.rulecomponent.jira.action.outgoingwebhook.OutgoingWebhookActionConfig$Header"value")
The error occurs because the JSON format for automation rules varies between Data Center and Cloud versions of Jira.
Correct JSON formatting before import
To solve this error, we need to make the exported JSON from Jira Data Center compatible. The error usually occurs for the action Send web request. Let's compare an exported Send web request action from Jira Data Center to the Jira Cloud version:
Data Center JSON:
"headers": [
{
"id": "_header_1651001557802",
"name": "Content-Type",
"value": {
"keyOrValue": "application/json",
"secret": false
}
}
]
Cloud JSON:
"headers": [
{
"id": "_header_1650999925513",
"name": "Content-Type",
"value": "application/json",
"headerSecure": false
}
]
We can see that the JSON differs in these ways:
The "value" key is of type String in Cloud as opposed to the Object type in Data Center
The "secret" variable is referred to as "headerSecure" in Cloud
To solve this, edit the exported JSON file as below:
Search for text "headers" in your file
For each occurrence, make the below changes:
Change the "value" element as shown above
Rename "secret" to "headerSecure"
Please feel free to reach out to support if you have any questions. Please consider including your exported file or a sample of the file in your support request for support to examine and review.
Was this helpful?