The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Syed.Naqib
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!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

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
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!
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
aeirola_terveystalo
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!
March 15, 2021
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"}
TAGS
AUG Leaders

Atlassian Community Events