Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,998
Community Members
 
Community Events
176
Community Groups

how to generate code report in PRs

I am trying to use code report insights, 

I follows the docs,and I added this to the pipeline

script:
- >
curl --request PUT 'http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002' \
--header 'Content-Type:application/json' \
--data-raw '{ "title": "Security scan report",
"details": "This pull request introduces 10 new dependency vulnerabilities.",
"report_type": "SECURITY",
"reporter": "mySystem",
"link": "http://www.mysystem.com/reports/001",
"result": "FAILED" }'

 however, it does not work


` % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 291 0 0 100 291 0 32333 --:--:-- --:--:-- --:--:-- 32333 `

 

1 answer

0 votes

Hi @Hudhayfah,

I think there are two issues with the API call you are making:

1. You are not providing any authentication credentials or token in the API call.

You can use either OAuth, or Bitbucket username + app password. You can take a look at the following page and if you have any questions please feel free to let me know:

2. You will need to remove the quotes from the url, so instead of

'http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002'

use

http://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/commit/$BITBUCKET_COMMIT/reports/mysystem-002

Otherwise, the variables in the URL won't get replaced with their actual values.

Please feel free to let me know how it goes and if you need further help.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events