Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Troubleshooting Server to Cloud rule migrations

If you're working on a Server to Cloud migration, you'll want to bring your Automation rules along! Luckily you can export your entire Automation ruleset as a JSON file, and import it into another environment. The product documentation describes how this works, but in short you simply select the option to export or import from the '...' menu in the upper right corner of the Automation page.

image.png

There are a couple hangups to be aware of:

 

Field, status, and issue type mapping 

If the Automation rules reference fields that don't exist in the site you've imported the rules to, the rules won't work!

Luckily, during a Server -> Cloud migration, the fix for this is pretty simple. The Jira Cloud Migration Assistant will add all the necessary items in your Cloud site for these object types. Simply do your Migration Assistant run before importing the rules, and all these objects should be in place before any automation rules might trigger.

 

Error parsing provided JSON

Automation will try to give you some sense of what is causing the import to fail if you encounter this error:

image.png

In this example, the Server export contains an action provided from the nFeed plugin, and a corresponding action didn't exist on the Cloud site. Without going back to the Server and deleting that rule entirely, it is possible to modify the JSON file so it imports successfully.

The rules export files are minified json. In order to work with the file, you'll want to beautify it. As a vim user, I simply run a vim command once the json file is opened:

:%!python -m json.tool

Online options exist to do this in-browser as well, like jsonformatter.org or jsonformatter.io . And depending on your preferred IDE or text editor, there's probably a JSON formatter in there too!

Once you've got the file beautified, search for the component mentioned in the error message. If you want to simply exclude the offending rule from the export, you can delete the rule from the file.

The first key in a server-exported rule is typically "actorAccountID" and the last is typically "updated". You should also select and delete the curly brackets above and below these lines - and if you're in a tool that parses JSON, it should validate in the tool once the whole node is removed. Some tools let you collapse nodes, which also helps ensure you remove the entire object. In Cloud, the first and last keys don't follow this format, so exercise caution! Definitely use tooling to help validate you've removed the whole object.

delete_rule.gif

In this example gif, we use JSON Formatter to collapse a rule, then delete it

 

Once the JSON file is modified, you can save it and try importing to Automation again in your Cloud site. You do not need to re-minify the file in order to upload it. Automation will happily import the expanded file.

 

In some cases, you may indeed need to reach out to Atlassian Support for assistance when importing rules into Automation in Jira Cloud. In many cases however, these checks and changes will help you get your rules imported in no time flat.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events