Errors while importing automation rules JSON from Server/Data Center to Cloud
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
While attempting to migrate Automation rules from Jira Data Center/Server to Jira Cloud, users may receive the below 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")
Environment
Jira Cloud
Cause
The error occurs because the JSON format for automation rules varies between the server/Data Center version and the cloud.
Solution
To solve this error, we need to make the exported JSM from the Server/Data Center compatible with the Cloud. The above error usually occurs for the action Send web request, and if we compare the action on how it looks when exported from the Server as compared to the Cloud, it looks as below:
"headers": [
{
"id": "_header_1651001557802",
"name": "Content-Type",
"value": {
"keyOrValue": "application/json",
"secret": false
}
}
]
"headers": [
{
"id": "_header_1650999925513",
"name": "Content-Type",
"value": "application/json",
"headerSecure": false
}
]
Comparing the above JSON, we can see that the action varies as below:
- The "value" key is of type String in Cloud as opposed to object type in Server/Data Center.
- The "secret" variable is referred to as "headerSecure" in the Cloud.
Hence, 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