Automation for JIRA Export from DC and import into cloud - Error

Mano Chitra August 30, 2024

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.

 

1 answer

0 votes
Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

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!

Mano Chitra August 30, 2024

Hi @Anandhi Arumugam _Cprime_ 

 

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?

Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

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.

Mano Chitra August 30, 2024

Hi @Anandhi Arumugam _Cprime_ 

 

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},

 

 

Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

@Mano Chitra Yes. Please remove those. Then ensure that the JSON formatting is right before importing.

Mano Chitra August 30, 2024

@Anandhi Arumugam _Cprime_ 

 

Sure. I'm on that. Will provide an update immediately about the results.

Mano Chitra August 30, 2024

@Anandhi Arumugam _Cprime_ 

 

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.

 

  • 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.util.ArrayList<com.codebarrel.automation.api.config.ComponentConfigBean>` from Object value (token `JsonToken.START_OBJECT`) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 250486] (through reference chain: com.codebarrel.automation.api.config.ImmutableRuleConfigExport$Json["rules"]->java.util.ArrayList[68]->com.codebarrel.automation.api.config.RuleConfigBean["components"])
Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

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.Automation Rules Import.png

Mano Chitra August 30, 2024

@Anandhi Arumugam _Cprime_ 

 

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.

Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

@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?

Mano Chitra August 30, 2024

@Anandhi Arumugam _Cprime_ 

 

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.

  • 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.util.ArrayList<com.codebarrel.automation.api.config.ComponentConfigBean>` from Object value (token `JsonToken.START_OBJECT`) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 251051] (through reference chain: com.codebarrel.automation.api.config.ImmutableRuleConfigExport$Json["rules"]->java.util.ArrayList[68]->com.codebarrel.automation.api.config.RuleConfigBean["components"])
Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

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?

Mano Chitra August 30, 2024

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.

Anandhi Arumugam _Cprime_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2024

Did you try to import only one rule? Just checking if import in general is an issue or just specific rules.

Mano Chitra September 2, 2024

Hi @Anandhi Arumugam _Cprime_ 

 

I tired to import only one rule but the error is 

 

  • Error parsing provided JSON. Please ensure it was created using 'Export rules' previously. If the problem persists please contact Atlassian support! Error: JsonParseException: Unexpected character ('}' (code 125)): expected a value at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 314]

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.0
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events