Hi Team,
I work on migration from JIRA DC into cloud where I did not found an automation migration path available for the plugin "Automation for JIRA" and vendor suggested to do an export from DC and import into cloud.
Doing so ended up with an error mentioned below.
Error
Error parsing provided JSON. Please ensure it was created using 'Export rules' previously. If the problem persists please contact Atlassian support! Error: IllegalStateException: Component for type ComponentTypeKey{component=ACTION, type='com.onresolve.jira.groovy.groovyrunner:execute-script-issue-action'} no longer exits.
Again from vendor the suggestion is to check with Script runner vendor as the error is related to the plugin "Script runner for JIRA".
Received a response to check an article which shows the difference between JQL functions of Script runner where there are some changes between DC and cloud the way the the scripting implemented is different too.
Does anyone came across such situation and know a work around? Looking forward for a response.
Hi @Mano Chitra Welcome to the community!
The error means that one/few of you Automation Rules have an action that executes a script written within Script Runner for Jira. Execute a Script action is available on Server/DC but not on Jira Cloud. So you will need to do 2 things to get this working.
1. Identify rules that have the Execute script action.
2. Export everything else and import
3. Find way to work on recreating the identified Automation rules using alternate methods.
Hope this helps!
Thanks for the quick response on my query!
I would like to confirm my understanding here. I should check the automation rules which has the setup that is framed with executing a script.
If that is right. My confusion is how to exclude the particular automation rule from exporting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mano Chitra You will not be able to select the rules you want to export. But you will be able to choose what you want to import.
If not, you can tweak the JSON file exported to remove specific rules that have the Automation rules in it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies for multiple questions on the same thing. I'm not that familiar with both the plugins Automation for JIRA and Script runner.
From the exported Automation rules file(JSON), I could see multiple entries like below with the key word com.onresolve... Can i go a head and remove those entries and then try to import the file in the cloud?
:[{"id":"67736","component":"ACTION","schemaVersion":1,"type":"com.onresolve.jira.groovy.groovyrunner:execute-script-issue-action","value":{"parameters":{"note":["update cdm management"],"FIELD_INLINE_SCRIPT":[""],"FIELD_SCRIPT_FILE":["update_cdmmanagement.groovy"]}},"children":[],"conditions":[],"optimisedIds":[],"newComponent":false},
{"id":"67737","component":"ACTION","schemaVersion":1,"type":"com.onresolve.jira.groovy.groovyrunner:execute-script-issue-action","value":{"parameters":{"note":["update bmcdma"],"FIELD_INLINE_SCRIPT":[""],"FIELD_SCRIPT_FILE":["update_bmcdma.groovy"]}},"children":[],"conditions":[],"optimisedIds":[],"newComponent":false},
{"id":"67738","component":"ACTION","schemaVersion":1,"type":"com.onresolve.jira.groovy.groovyrunner:execute-script-issue-action","value":{"parameters":{"note":["update lab cdma"],"FIELD_INLINE_SCRIPT":[""],"FIELD_SCRIPT_FILE":["update_labcdma.groovy"]}},"children":[],"conditions":[],"optimisedIds":[],"newComponent":false},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mano Chitra Yes. Please remove those. Then ensure that the JSON formatting is right before importing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I removed 67 entries as mentioned in previous inputs those type of entries from the exported automation rules file(JSON).
Tried importing it and found below error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried to choose when you import? You should get a screen like in the screenshot. You should be able to choose the rules you need to import here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It restricted me at the first level when fetching the JSON file. Once that is success then only I could see that page which you mentioned in the screenshot.
I noticed few difference between DC and cloud export files of automation rules.
Below are the changes.
1) First line of the file in DC
{"rules":[{"id":658,"clientKey":"com.codebarrel.tenant.global",
and in cloud it looks like this
{"cloud":true,"rules":[{"id":20367468,"clientKey":"47aff0b6-d1d9-3027-8400-2fd1808d8779",
2) In all place where client key occurs the difference is updated total 144 entries made changes but I'm not sure whether the client key should be the one which i entered. Just got the client key from the export file of the same cloud instance where i'm trying to import the rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mano Chitra The client key and ids will be different to what you have on DC vs Cloud. This is because the Automation rules are created new here. What is the issue when you try the import?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah I agree client keys will be different between sites but I have no idea to identify the right one for my case.
When I modified the JSON file some how with client key and tried importing. This is the error. Also the error is same when I tried importing the JSON file after removing the rules related to script runner and before modifying the client key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to import the unmodified file and choose the rules that you want to import. May be try a couple of rules and see if you can import without any issues?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Even unmodified file too throwed the same error.
Looks like most of the things like project id JIRA user id etc are difference between two sites of different platforms. I think it is better to manually create a ll automation rules in the cloud from the scratch though it is time taking task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try to import only one rule? Just checking if import in general is an issue or just specific rules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tired to import only one rule but the error is
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.