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,362,012
Community Members
 
Community Events
168
Community Groups

Reports API (Code insights) - Sending value type LINK in data array.

Edited

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?

1 answer

1 accepted

1 vote
Answer accepted

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. 

Like Eddie Webbinaro likes this

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.


Like Syed.Naqib likes this
Like Syed.Naqib likes this

@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"}

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

3,503 views 3 10
Read article

Atlassian Community Events