Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to import test steps in csv file to JIRA project

Ксения Луканова February 11, 2019

Unable to import test steps in csv file to JIRA project. Please explain me how should test steps be written, if I import my CSV without Xray Importer.

On the photo is how I map my fields.

It is my CSV which I am try to import:

 

TCID,Summary,Issue Type,Priority,Test Type,Manual Test steps
1,Симпл,Test,Low,Manual,"[{index:0,Step:"Step 1",Data:"data 1",Expected Result:"result 1"},{index:1,Step:"Step 2",Data:"data 2",Expected Result:"result 2"}]"image001.jpg

 

This is my Error log:

 

com.atlassian.jira.plugins.importer.imports.csv.CsvDataBean

2019-02-11 15:29:20,518 INFO - ------------------------------

2019-02-11 15:29:20,518 INFO - Importing: Users

2019-02-11 15:29:20,518 INFO - ------------------------------

2019-02-11 15:29:20,518 INFO - Only new items will be imported

2019-02-11 15:29:20,518 INFO - 0 users associated with import. 0 new users were created and imported as active.

2019-02-11 15:29:20,518 INFO - ------------------------------

2019-02-11 15:29:20,518 INFO - Finished Importing : Users

2019-02-11 15:29:20,518 INFO - ------------------------------

2019-02-11 15:29:20,518 INFO - 0 users successfully created.

2019-02-11 15:29:20,518 INFO - Retrieving projects...

2019-02-11 15:29:20,519 INFO - Project ExternalProject{id=null, externalName=null, name=null, key=DMD, url=null, lead=null, description=null, projectCategoryName=null, avatarUrl=null, assigneeType=null, versionCount=0, componentCount=0, issueCount=0} already exists. Not imported

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Importing: Versions

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Only new items will be imported

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Finished Importing : Versions

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Importing: Components

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Only new items will be imported

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Finished Importing : Components

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Retrieving custom fields...

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Importing: Issues

2019-02-11 15:29:20,519 INFO - ------------------------------

2019-02-11 15:29:20,519 INFO - Only new items will be imported

2019-02-11 15:29:20,521 INFO - Importing issue: ExternalIssue{externalId=autoid-307905542724527191, summary=Симпл, issueType=Test}

2019-02-11 15:29:20,531 WARN - Cannot add value [ [[{index:0,Step:Step 1,Data:data 1,Expected Result:result 1},{index:1,Step:Step 2,Data:data 2,Expected Result:result 2}]] ] to CustomField Manual Test Steps in Issue null. Exception Message: Error occurred while deserializing JSON test steps

com.atlassian.jira.issue.customfields.impl.FieldValidationException: Error occurred while deserializing JSON test steps

        at com.xpandit.raven.customfield.ManualTestStepsCustomField.getSingularObjectFromString(Unknown Source)

        at com.xpandit.raven.customfield.ManualTestStepsCustomField.getValueFromCustomFieldParams(Unknown Source)

        at com.xpandit.raven.customfield.ManualTestStepsCustomField.getValueFromCustomFieldParams(Unknown Source)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldValueFactory.prepareValueForCustomField(CustomFieldValueFactory.java:55)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.customfields.CustomFieldsUtil.setCustomFieldValueForIssue(CustomFieldsUtil.java:182)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importExternalCustomFields(DefaultJiraDataImporter.java:1203)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.createIssue(DefaultJiraDataImporter.java:893)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.importIssues(DefaultJiraDataImporter.java:764)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.DefaultJiraDataImporter.doImport(DefaultJiraDataImporter.java:390)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:26)

        at com.atlassian.jira.plugins.importer.imports.importer.impl.ImporterCallable.call(ImporterCallable.java:15)

        at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:527)

        at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:490)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)

        at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:253)

        at java.lang.Thread.run(Thread.java:745)

2019-02-11 15:29:21,071 INFO - Cannot add inactive User(s): DKX6KE5 to role 'Developers' in project 'Demand Enhancements'

2019-02-11 15:29:21,071 INFO - Reindexing last 1 issues imported ...

2019-02-11 15:29:21,331 INFO - Reindexing took 258 ms.

2019-02-11 15:29:21,331 INFO - 1 issues successfully created

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - Finished Importing : Issues

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - Importing: Issue Links & Subtasks

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - Only new items will be imported

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - Finished Importing : Issue Links & Subtasks

2019-02-11 15:29:21,331 INFO - ------------------------------

2019-02-11 15:29:21,331 INFO - No issues need to be reindexed.

2 answers

0 votes
Andreas
Contributor
September 2, 2021

Hi @Ксения Луканова 

you've missed the JSON format. Due to the new feature of having custom test step fields, the structure of the JSON needs to be adjusted: e.g.

[
{
"index": 1,
"fields": {
"Action": "Step 1",
"Data": "data 1",
"Expected Result": "result 1"
},
"attachments": []
},

{
"index": 2,
"fields": {
"Action": "Step 2",
"Data": "data 2",
"Expected Result": "result 2"
},
"attachments": []
}
]

The new key "fields" is an object which stores the default fields as well as any test step custom fields you might want to use. 

Cheers

Andreas

Sergio Freire - Xblend
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2021

Exactly, thanks @Andreas 

Like Andreas likes this
0 votes
Sergio Freire - Xblend
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2021

Hi @Ксения Луканова ,

the official supported process is by using the built-in Test Case Importer, which is based on CSV files having a specific layout.

More info here.

It should be possible to import using the standard CSV, but it's not the recommended way as it is harder to manage. More info on the exact layout for the steps here.

Regards

Sergio

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events