0

Now we are on the process of migration from Jira server to the Jira cloud. We are using Zephyr for Test Cases. For now we have 1843 and they must be migrated as other tickets to Jira cloud. We do not need to migrate all Test Cycles and all history of test execution, we need only Test Cases to use it in future Test Cycles.

This article contains answer on the same question https://support.getzephyr.com/hc/en-us/community/posts/205799785-How-to-migrate-from-JIRA-Server-to-JIRA-Cloud

but utility doesn't work properly for me, after pressing Start Import button nothing happens. How to migrate Test Cases from server Jira to cloud with Test Steps in Zephyr?

Vladimir
  • 91
  • 6

1 Answers1

0

Finally I found the solution how to import all 1843 Test Cases automatically via tool from the article mention in the question.

  1. Our test-cases were migrated to the cloud Jira as usual tickets. They have no Test Steps but have all other information like Description, Labels and other which relate to Jira fields. Further I will show how to migrate all steps to the migrated Test Cases without steps.

  2. Go to your Jira and Export Test Cases that you need to Excel file. It can be done from this screen https://zephyrdocs.atlassian.net/wiki/spaces/ZTD/pages/12386325/Search+Test+Executions

  3. Download .jar file from the https://bitbucket.org/zfjdeveloper/zfj-importer/downloads/

  4. In cmd run this jar file via command java -jar zfj-importer-utility-0.40.jar I tried to run jar file by double click, application opens but after configuration and press button Start Import nothing happens. Only after opening from cmd everything works. Plus in cmd you can see progress and error details which will help you in debug.

  5. Configure utility as in documentation https://bitbucket.org/zfjdeveloper/zfj-importer/wiki/Home

  6. At this point I though that after pressing Start Import everything will be perfect, but no. In console I found a lot of error, their reason was a lot of line breaks inside test steps. Lets say you have one step with one row in Step field, one row In Test Data field but in Execution result field you have text with line breaks, lets say 4 rows. For this case in excel Execution result field will be 4 different columns, Step field and Test Data as one merged column. And based on utility rules there impossible to have result without step. (such issue can be if you have line break in Step field and Test Data). 3 cells with result for one step Below I will show how I handle it.

  7. I decided to write Excel function which will get rows from not merged rows for one step, concatenate them and provide to import. Excuse me for my VBA, I have never use it before. Everything that I wrote can be rewritten in better way and in one script, but it works for me and I do not want to spend time more on this issue, so let go. Below you can find 4 excel function. 3 of them are quite similar and difference is only in one letter. Last scrip is for deleting empty rows which were concatenated, without it steps with value "null" will be created.

Public Const lastTableRow = 3872

Function ConvertSteps()
    Dim callerRow As Long
    Dim isValueInStepId As Boolean
    Dim isNoValueInNextStepId As Boolean
    Dim result As String
    Dim baseColumnLetter As String
    Dim stepIdColumnLetter As String

    callerRow = Application.Caller.row
    baseColumnLetter = "S"
    stepIdColumnLetter = "Q"

    Debug.Print "processed row is: " & callerRow

    isValueInStepId = (Range(stepIdColumnLetter & callerRow).Value <> "")
    isNoValueInNextStepId = (Range(stepIdColumnLetter & (callerRow + 1)).Value = "")

    If isValueInStepId And isNoValueInNextStepId Then
        Dim i As Integer
        i = 1

        result = Range(baseColumnLetter & callerRow).Value

        Do While Range(stepIdColumnLetter & (callerRow + i)).Value = "" And (callerRow + i) <= lastTableRow
            result = result & "     " & Range(baseColumnLetter & (callerRow + i)).Value

            i = i + 1
        Loop

        ConvertSteps = result
    Else
        If Range(baseColumnLetter & (callerRow)).Value = "" Then
            ConvertSteps = ""
        Else
            ConvertSteps = Range(baseColumnLetter & (callerRow)).Value
        End If
    End If
End Function

Function ConvertTestData()
    Dim callerRow As Long
    Dim isValueInStepId As Boolean
    Dim isNoValueInNextStepId As Boolean
    Dim result As String
    Dim baseColumnLetter As String
    Dim stepIdColumnLetter As String

    callerRow = Application.Caller.row
    baseColumnLetter = "T"
    stepIdColumnLetter = "Q"

    Debug.Print "processed row is: " & callerRow

    isValueInStepId = (Range(stepIdColumnLetter & callerRow).Value <> "")
    isNoValueInNextStepId = (Range(stepIdColumnLetter & (callerRow + 1)).Value = "")

    If isValueInStepId And isNoValueInNextStepId Then
        Dim i As Integer
        i = 1

        result = Range(baseColumnLetter & callerRow).Value

        Do While Range(stepIdColumnLetter & (callerRow + i)).Value = "" And (callerRow + i) <= lastTableRow
            result = result & "     " & Range(baseColumnLetter & (callerRow + i)).Value

            i = i + 1
        Loop

        ConvertTestData = result
    Else
        If Range(baseColumnLetter & (callerRow)).Value = "" Then
            ConvertTestData = ""
        Else
            ConvertTestData = Range(baseColumnLetter & (callerRow)).Value
        End If
    End If
End Function

Function ConvertResult()
    Dim callerRow As Long
    Dim isValueInStepId As Boolean
    Dim isNoValueInNextStepId As Boolean
    Dim result As String
    Dim baseColumnLetter As String
    Dim stepIdColumnLetter As String

    callerRow = Application.Caller.row
    baseColumnLetter = "U"
    stepIdColumnLetter = "Q"

    Debug.Print "processed row is: " & callerRow

    isValueInStepId = (Range(stepIdColumnLetter & callerRow).Value <> "")
    isNoValueInNextStepId = (Range(stepIdColumnLetter & (callerRow + 1)).Value = "")

    If isValueInStepId And isNoValueInNextStepId Then
        Dim i As Integer
        i = 1

        result = Range(baseColumnLetter & callerRow).Value

        Do While Range(stepIdColumnLetter & (callerRow + i)).Value = "" And (callerRow + i) <= lastTableRow
            result = result & "     " & Range(baseColumnLetter & (callerRow + i)).Value

            i = i + 1
        Loop

        ConvertResult = result
    Else
        If Range(baseColumnLetter & (callerRow)).Value = "" Then
            ConvertResult = ""
        Else
            ConvertResult = Range(baseColumnLetter & (callerRow)).Value
        End If
    End If
End Function

Public Sub DeleteBlankRows()
    Dim SourceRange As Range
    Dim EntireRow As Range

    Set SourceRange = Range("Q1", "Q" & lastTableRow)

    If Not (SourceRange Is Nothing) Then
        Application.ScreenUpdating = False

        For i = SourceRange.Rows.Count To 1 Step -1

            Set EntireRow = SourceRange.Cells(i, 1).EntireRow

            Debug.Print SourceRange.Cells(i, 1).Value

            If SourceRange.Cells(i, 1).Value = 0 Then
                EntireRow.Delete
            End If
        Next

        Application.ScreenUpdating = True
    End If
End Sub
  1. Let's open Excel file and save it in .xlsm format to apply custom functions.

  2. Import functions to Excel

  3. in the top of the code set in variable lastTableRow last row with Test Case step in your Excel.

  4. Now we need 3 new columns to save transferred Step, Test Data and Result fields. For this purpose we can use last column Comments, copy and past it two times. Now we have 3 empty column W, X, Y for our purpose.

  5. For all rows in column W apply formula =ConvertSteps() to agregate steps (it can take some time)

  6. For all rows in column X apply formula =ConvertTestData() to agregate test data (it can take some time)

  7. For all rows in column Y apply formula =ConvertResult() to agregate results (it can take some time) enter image description here

  8. Now we have to convert values in new columns from formula to their string value. To do it select all table and press Ctrl+C. Then press right button and choose past values.

  9. Run DeleteBlankRows macros to delete all rows that we do not need to import.

  10. Save file in .xml format.

  11. Choose this file in Utility and press Start Import

  12. In cmd you can see a few errors. In my case they were releted to situation when there is no step description but there is expected result. If they are quite seldom as in my case, it's easier to change it mannualy in Execel file. If there a lot of them you can handle this case in custom function. enter image description here

So thats it, this solution helped me to import 1800+ Test Cases. I have exported them partially, by 500 and for me it takes about 3 hour to import all Test Cases.

Vladimir
  • 91
  • 6