0

I'm trying to assign quality profile to a project created in Sonar qube using a batch script. It was working perfectly fine when using shell script in Unix

curl -u <token>: -X POST "http://sonarqube-qa.it.company.net:9000/api/qualityprofiles/add_project?profileName=TEST%E2%80%93MSBI%E2%80%93SSIS&projectName=%project_name%&projectKey=%project_key%&language=xml"

Name of quality profile:-

TEST-MSBI-SSIS

Error message when executing the batch script, which is working fine when executing unix shell script.

{"errors":[{"msg":"Quality Profile for language 'xml' and name 'TEST803MSBI803SSIS' does not exist"}]}

What is the windows equivalent of %E2%80%93 to replace '-' as in Unix

Leo
  • 868
  • 1
  • 13
  • 32
  • 1
    From a batch file, you should double all **`%`** characters, except for those surrounding your variables, `%project_name%` and `%project_key%` – Compo Sep 07 '18 at 12:49
  • Thank you very much. It worked :-) I used TEST%%E2%%80%%93MSBI%%E2%%80%%93SSIS. – Leo Sep 07 '18 at 13:21
  • @Compo Can you put this in answer so that I can mark it as correct – Leo Sep 07 '18 at 13:23

1 Answers1

1

As per my comment:

From a batch file, you should double all % characters, except for those surrounding your variables, %project_name% and %project_key%.

For instance:

curl -u <token>: -X POST "http://sonarqube-qa.it.company.net:9000/api/qualityprofiles/add_project?profileName=TEST%%E2%%80%%93MSBI%%E2%%80%%93SSIS&projectName=%project_name%&projectKey=%project_key%&language=xml"
Compo
  • 36,585
  • 5
  • 27
  • 39