Api/project_tags/set overwrites existing tags

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube Enterprise 9.3

  • what are you trying to achieve
    Adding/Updating tags using api/project_tags/set API for projects

  • what have you tried so far to achieve this
    The set api set the tags to projects, but also overrides existing tags.
    If there is tag that is already present eg. “java” and when i try to add “microservice” tag to the project using set API, it only show microservice tag. The java tag is overridden.

I am missing something or this by default functionality of “api/project_tags/set” API.
Is there any way that i can to add tag but the existing one doesn’t get effected.

Hi,

Have you tried this via the UI? The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action.

You may also find this guide helpful.

 
HTH,
Ann

Yes, I have tried from UI. With UI we can simply add new tags without effecting the existing one.

I followed the guide and it seems the API call is same, but it seems the call send POST request with both the tags.