# Setting project settings via REST calls

**URL:** <https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711>\
**Category:** SonarQube Server / Community Build\
**Tags:** settings, web\_api, sonarqube, scanner\
**Created:** [April 18, 2024, 6:35am UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711 "2024-04-18T06:35:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delcho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/delcho/32/56760_2.png) [@Delcho](https://community.sonarsource.com/u/Delcho)\
**Post date:** [April 18, 2024, 6:35am UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/1 "2024-04-18T06:35:04Z")

</div>

- Sonar version used 9.9
- Im trying to set sonar.issue.ignore.multicriteria setting for a lot of projects(but not all on the server) and with 60 entries. I want to set this using the API call **POST api/settings/set**.
- I have tried to run the request with the parameter key - sonar.issue.ignore.multicriteria and fieldValues -json array, where each entry is pair of ruleKey and resourseKey like this:  
{ “resourceKey”: “ **/com/** /gui/\*\*”, “ruleKey”: “java:S1948” }  
but I receive an exception that tgis is not the right format for fieldValues. I have also tried to run the request for a singe project many times, each with different combination like above, but the calls seems to overwrite the value, not to add new entries.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 18, 2024, 8:25am UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/2 "2024-04-18T08:25:47Z")

</div>

I think this guide should help you.

> [@How to reverse engineer the Sonar Web API](https://community.sonarsource.com/t/how-to-reverse-engineer-the-sonar-web-api/66810):
>
> Every action that is taken in the SonarQube / SonarCloud UI is driven by the Web API. There is nothing you can do in SonarQube / SonarCloud that you cannot do using the Web API. warning We put a great deal of effort into the UI and UX of our products and sincerely think that most actions should be completed there. Especially when it comes to viewing analysis results, the UI is the best place to view up-to-date information with the right context. We think it is much better that you give access…

---

<div class="post-metadata">

**Author:** ![Delcho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/delcho/32/56760_2.png) [@Delcho](https://community.sonarsource.com/u/Delcho)\
**Post date:** [April 18, 2024, 8:40am UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/3 "2024-04-18T08:40:45Z")

</div>

Hi,

Thanks for the fast reply. Im already aware of how to find the right API endpoint but, after I have tried many time to set many rules for the above mentioned sonar setting but all attempts resulted in adding one single value and overwriting it each time I try to add one new.  
For this reason I decided to ask the community here because nothing was mentioned especially this kind of project setting

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [April 18, 2024, 8:44am UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/4 "2024-04-18T08:44:45Z")

</div>

The value does get overwritten entirely each time – so you may need to pull any existing values and then add on the new values to your request.

I mentioned the guide because it should show you exactly how it expects the requests to be formatted.

---

<div class="post-metadata">

**Author:** ![Delcho](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/delcho/32/56760_2.png) [@Delcho](https://community.sonarsource.com/u/Delcho)\
**Post date:** [April 18, 2024, 4:09pm UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/5 "2024-04-18T16:09:05Z")

</div>

Thanks, I used to Java SDK and I manage to set the the fields

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [April 25, 2024, 4:09pm UTC](https://community.sonarsource.com/t/setting-project-settings-via-rest-calls/113711/6 "2024-04-25T16:09:11Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
