Import the Issues into Sonarqube - Community Edition

Hi Team,

I have a CSV report which was generated by third party analyzers and want to import them into the Sonarqube. How to convert that into a specific format to be able to import into Sonarqube?

I see that there is a link that states we need to have in generic issue format and do we need to convert our CSV columns and its values to JSON format?

https://docs.sonarqube.org/latest/analysis/generic-issue/

If I convert the CSV to JSON with any converters, will we be able to import them into Sonarqube directly? or should It have the similar keys mentioned in the Import format (engid, ruleid, primary location, type, severity)?

Please suggest me a better method.

Thanks,
Prasad.

Hey there.

Yes, your report will need to be converted to the Generic Issue Format to be imported during analysis.

And, we really wouldn’t recommend importing them into SonarQube if this list isn’t being continually updated (i.e. if the third-party analyzers aren’t running during each build and producing a fresh report). The results will otherwise become stale (or cause an analysis failure, if a line in the report ceases to exist).

Keep in mind that SonarQube also supports a number of third-party analyzer report formats natively.

Hi Colin,

Do we need to have the same keys as mentioned in the generic issue format?

**engineId **
ruleId
**primaryLocation **
**type **
**severity **
**effortMinutes **
secondaryLocations

I have a CSV file with different columns name and can we use those column name as keys? or else do we need to have the same keys with the values of the keys of the CSV file?

Thanks,
Prasad.

Yes, they must match exactly, although you can omit the fields mentioned as “optional” if they aren’t relevant.

1 Like

Thank you for ur response.