Missed Team ’24? Catch up on announcements here.

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

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

Syed.Naqib March 4, 2021

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
Eddie Webbinaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2021

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

Syed.Naqib March 9, 2021

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
Eddie Webbinaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2021

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
Mikhail Klimenko November 29, 2021

@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
AUG Leaders

Atlassian Community Events