Uploaded image for project: 'JIRA Importers Plugin'
  1. JIRA Importers Plugin
  2. JIM-596

Backslash in now a special character in CSV (JIM and JIRA specific)

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Suggestion Suggestion
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • None
    • CSV
    • None

      Due to changes in CSV parser a backslash became a special character.

      If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. In case it does the following character will be kept but the first backslash will be omitted.

      Both JIM and JIRA are affected. Probably worth mentioning somewhere?

            [JIM-596] Backslash in now a special character in CSV (JIM and JIRA specific)

            Just to be clear, this is for JIRA 4.4.4 onwards.

            Roy Krishna (Inactive) added a comment - Just to be clear, this is for JIRA 4.4.4 onwards.

            Giles, this issue is no longer valid. Roy decided we switch back to the good, old one CSV parser (https://studio.atlassian.com/browse/JIM-642) so if you did any changes to the documentation please rollback them.

            Pawel Niewiadomski (Inactive) added a comment - Giles, this issue is no longer valid. Roy decided we switch back to the good, old one CSV parser ( https://studio.atlassian.com/browse/JIM-642 ) so if you did any changes to the documentation please rollback them.

            Raised JIM-627 to fix it.

            Pawel Niewiadomski (Inactive) added a comment - Raised JIM-627 to fix it.

            @Roy, as you can see the parse does strange things in some cases. I think we should fix it.

            Pawel Niewiadomski (Inactive) added a comment - @Roy, as you can see the parse does strange things in some cases. I think we should fix it.

            I updated Giles comment with an exact output created by the importer.

            Pawel Niewiadomski (Inactive) added a comment - I updated Giles comment with an exact output created by the importer.

            Hi Pawel / Wojtek,

            Thanks Pawel for your explanation above, but unfortunately I'm still none the wiser. Perhaps it's just me but are you able to complete the following table of examples and I'll work out an explanation to describe this change in CSV parsing behaviour in our docco:

            In CSV file (i.e. the input file) What JIRA's new CSV parser converts this to:
            C:\Program Files C:rogram Files
            C:\‌\Program Files C:Program Files
            'C:\Program Files' 'C:rogram Files'
            'C:\‌\Program Files' 'C:Program Files'
            "C:\Program Files" C:rogram Files
            "C:\‌\Program Files" C:\Program Files
            C:'\'Program Files C:'Program Files
            C:'\‌\'Program Files C:''Program Files
            C:"\"Program Files Invalid line, there's an opening double-quote without a closing one.
            C:"\‌\"Program Files C:\"Program Files


            As you can see in the left column above, if you need to display two backslashes inside JIRA comments (i.e. without JIRA interpreting this as a 'new line' character), insert

             ‌ 

            between the two backslashes, that is...

             \‌\ 

            Giles Gaskell [Atlassian] added a comment - Hi Pawel / Wojtek, Thanks Pawel for your explanation above, but unfortunately I'm still none the wiser. Perhaps it's just me but are you able to complete the following table of examples and I'll work out an explanation to describe this change in CSV parsing behaviour in our docco: In CSV file (i.e. the input file) What JIRA's new CSV parser converts this to: C:\Program Files C:rogram Files C:\‌\Program Files C:Program Files 'C:\Program Files' 'C:rogram Files' 'C:\‌\Program Files' 'C:Program Files' "C:\Program Files" C:rogram Files "C:\‌\Program Files" C:\Program Files C:'\'Program Files C:'Program Files C:'\‌\'Program Files C:''Program Files C:"\"Program Files Invalid line, there's an opening double-quote without a closing one. C:"\‌\"Program Files C:\"Program Files As you can see in the left column above, if you need to display two backslashes inside JIRA comments (i.e. without JIRA interpreting this as a 'new line' character), insert ‌ between the two backslashes, that is... \‌\

            Ad. 1) Single quotes are not treated any special way. The sentence is valid for double quotes.

            Ad. 2) If you have a single line of text and it's not in double quotes you need to put

            C:\Program Files

            , but if it's in double quotes you need to use

            "C:\\Program Files"

            .

            Pawel Niewiadomski (Inactive) added a comment - Ad. 1) Single quotes are not treated any special way. The sentence is valid for double quotes. Ad. 2) If you have a single line of text and it's not in double quotes you need to put C:\Program Files , but if it's in double quotes you need to use "C:\\Program Files" .

            Hi Wojtek,

            Not just yet, because the following explanation is not entirely clear...

            If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. In case it does the following character will be kept but the first backslash will be omitted.

            Could we please clarify this statement? ...

            If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote.

            • When you say '...found inside quoted text...' do you mean single quotes or double quotes - or does this not matter? In other words...
              • "Go to C:\Program Files" will result in "Go to C:Program Files"
                OR
              • 'Go to C:\Program Files' will result in 'Go to C:Program Files'
            • When you say '...unless it precedes another backslash or a double quote...' do you mean that to end up with a backslash in the results, you need to have one of the following in your CSV file...
              • C:\‌\Program Files
                OR
              • C:"\"Program Files

            Could you please specify some examples of what a customer requires in their CSV input file to get a backslash imported into JIRA?

            Giles Gaskell [Atlassian] added a comment - Hi Wojtek, Not just yet, because the following explanation is not entirely clear... If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. In case it does the following character will be kept but the first backslash will be omitted. Could we please clarify this statement? ... If the backslash is found inside of quoted text it will be ignored (removed) unless it precedes another backslash or a double quote. When you say '...found inside quoted text...' do you mean single quotes or double quotes - or does this not matter? In other words... "Go to C:\Program Files" will result in "Go to C:Program Files" OR 'Go to C:\Program Files' will result in 'Go to C:Program Files' When you say '...unless it precedes another backslash or a double quote...' do you mean that to end up with a backslash in the results, you need to have one of the following in your CSV file... C:\‌\Program Files OR C:"\"Program Files Could you please specify some examples of what a customer requires in their CSV input file to get a backslash imported into JIRA?

            Giles, what is the status of this task? Can we close it?

            Wojtek Seliga (Inactive) added a comment - Giles, what is the status of this task? Can we close it?

            AFAIK it was committed before 4.4.1 was built.

            Wojtek Seliga (Inactive) added a comment - AFAIK it was committed before 4.4.1 was built.

              Unassigned Unassigned
              Anonymous Anonymous
              Archiver:
              dnorton@atlassian.com Dave Norton

                Created:
                Updated:
                Resolved:
                Archived: