Report annotations order ?
Asked by Romain T_:

Hello,  

I submit my annotations in bulk and in a specific order.

Unfortunately when they are displayed in the report they are in an order that doesn't make sense (not alphabetically, not by their id, not in the order I sent them in...)  
It makes it very hard to read them, as you jump from one thing to another without any context.

Is there a way to force their order ? Thanks!


Answers:
author: Mark C
body: Hi [@Romain T_](/t5/user/viewprofilepage/user-id/5038109),

Thank you for reaching out to the community.

For me to further check, would it be possible for you to confirm how exactly you've submitted annotations in bulk?  
Are you using an API and/or scripting at the moment?  
If yes, could you please provide the API endpoint you're using?

Looking forward to your response.

Regards,  
Mark C

comments: author: Romain T_
body: Hello!  

I'm just using the WEB API endpoint

```
https://api.bitbucket.org/2.0/repositories/$Env:BITBUCKET_REPO_OWNER/$Env:BITBUCKET_REPO_SLUG/commit/$Env:BITBUCKET_COMMIT/reports/$ReportId/annotations
```

<br />

<https://developer.atlassian.com/cloud/bitbucket/rest/api-group-reports/#api-repositories-workspace-repo-slug-commit-commit-reports-reportid-annotations-post>  

When I check my request in Fiddler, all the annotations are in the order I want by the way.  


author: Mark C
body: Hi [@Romain T_](/t5/user/viewprofilepage/user-id/5038109),

Thank you for that information.

I checked this on our end with the help of our developers as well.  
Unfortunately, viewing code insight reports on Bitbucket Cloud UI doesn't allow you to sort/order the result.  
For that, I went ahead and created a feature request for it that can be located through this link. - <https://jira.atlassian.com/browse/BCLOUD-22301>  
You can upvote and watch it for now so that you'll be notified of any updates from our team when the feature becomes available on Bitbucket Cloud.  
![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) Please do note that we don't have an exact ETA for the feature request as all new features will be implemented according to our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

As a workaround, you can get code insight annotations report via the GET API endpoint below where you can pass the parameter **?sort=summary** which will sort the result in ascending order. However, you can add a hyphen to reverse the sorting. (e.g. **?sort=-summary** )  
**API sorting for reference** : <https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering>

```
curl -u bbusername:app_pasword "https://api.bitbucket.org/2.0/repositories/workspace_id/repo_name/commit/COMMIT_HASH/reports/REPORT_ID/annotations?sort=summary"
```

![](https://getsupport.atlassian.com/images/icons/emoticons/information.png) Please note that you'll need to use your Bitbucket Cloud username and an [App password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) for authentication here.

Do let me know if you have further questions that I can help with.

Regards,  
Mark C


author: Romain T_
body: Thank you for looking in this and creating the issue, I've voted for it then :)


author: Mark C
body: Hi [@Romain T_](/t5/user/viewprofilepage/user-id/5038109),  

Glad to know you've voted for the feature request.  

Do let me know if you have further questions that I can help with and feel free to mark this question as answered as well.

Regards,  
Mark C


Tags: annotation

bitbucket-cloud

cloud

report