I am working on adding reports to Pull Request view with code insights and reports API, however, I hit a snag when I was trying to send some test results reporting and the value type LINK.
I sent following in data array to add report API.
{
"title": "Detailed Report",
"value": "https://example.com/abcd_1234/reports/results?reportId=11223344",
"type": "LINK"
}
The response error was:
{"key": "report-service.general.bad-request", "message": "Value doesn't match expected type LINK", "arguments": {}}
I'm curious what format the API is expecting when you're sending a LINK value?
LINK is an object that is the 2 parts of link (text,href)
{"text": "Link text here", "href": "https://link.to.annotation/in/external/tool"}
(found that in server docs)
https://docs.atlassian.com/bitbucket-server/rest/5.15.0/bitbucket-code-insights-rest.html
This worked. Thanks a lot. Please don't mind me saying that, but Atlassian/bitbucket API documentation leaves a lot to be desired IMHO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't mind it! I'm glad you did. It's frustrating when things (especially api specs) are left to guess work.
I've actually raised an internal issue to bubble this note up in our cloud docs as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would be good to add to the bitbucket cloud documentation at https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/reports/%7BreportId%7D#put or https://support.atlassian.com/bitbucket-cloud/docs/code-insights/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Syed.Naqib Could you show your full JSON, please? I'm still trying to make it work but getting the error response all the time:
{"code": 400, "message": "Unable to process JSON"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.