Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Code Insights REST API for configuring the requirements

Radek Antoniuk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 4, 2021

There is the Code Insights functionality provided by BitBucket Server and we are using this together with SonarQube integration to provide feedback from the CI pipeline and have a quality gate as the screenshot below shows:

Screenshot 2021-02-04 at 13.43.51.png

Now, this is configurable via the UI, but as we are managing a large number of repositories/project, we'd like to keep this configuration in the code and manage it via the API.

However, looking at the REST API for Code Insights and for Repository Management, it seems that BitBucket does not expose a way to manage the Code Insights Requirements settings via API.

Is that possible or would it make sense to add this to the roadmap?

 

3 answers

1 accepted

0 votes
Answer accepted
Adam
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 16, 2022

I couldn't find any documentation on this either, but the web interface is using the REST API as well.

From the browsers dev console the API endpoint for repositories seems to be:

https://bitbucket.company.com/rest/insights/latest/projects/PROJECT/repos/REPO/merge-check/KEY

PUT/GET/DELETE calls are supported. For PUT the following json payload can be used

{
"reportKey":"KEY",
"mustPass":true, // true/false
"minProhibitedSeverity":"LOW" // LOW/MEDIUM/HIGH or omit this key
}

For project-wide configuration: 

https://bitbucket.company.com/rest/insights/latest/projects/PROJECT/merge-check/KEY

Radek Antoniuk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2022

DevConsole always to the rescue! Simplest solution always works, thanks for this!

0 votes
Radek Antoniuk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2022

Just to bump the visibility - any hints?

0 votes
Radek Antoniuk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2021

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events