Forums

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

Description not showing in Updating build status for commits

Amulya Kota November 5, 2024

Hi,

Description is not showing when I posted a build status update for a commit using the Rest API using this link

https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/

I am using the PowerShell Invoke-WebRequest method to post the update on the Bitbucket commit. 

{

    "state": "INPROGRESS",

     "key": "TEST",

      "name": "TEST",

      "url": "testurl/console",

       "description": "Changes by Amulya"

}

All other 4 are visible except description. Can anyone please help me find the issue? 
The versions we use are 

  • Atlassian Bitbucket v7.21.19 (Datacenter)
  • Jenkins 2.472

Capture.JPG

 

Capture2.png

1 answer

1 accepted

3 votes
Answer accepted
Zuri Suwru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2024

Hey there Amulya,

First off, let me kindly warn you that even though you blurred your bearer token out in the first picture, it is present and visible in the second.

That aside, would it be possible to see the entirety of the code? The last part of the web request is not visible, nor is it possble to see how the JSON is constructed.

Taking a wild guess here, but if everything else updated besides the description, it may be that the description you are trying to pass is not correctly formatted? Have you tried passing it manually before just to debug?

Best regards,
Zuri Suwru

Amulya Kota November 6, 2024

Hi Zuri, thank you for your reply. 
Yes, I am posting the entire code here. I tried to pass the description manually, which was copied from the Atlassian documentation, also but still not visible. Also, thank you; I updated images on my original post.

Capture3.JPGCapture2.pngCapture4.JPG

 

 

Zuri Suwru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2024

In case you navigate (or send a GET request via your preferred way) to the following URL using your test case's commit hash, inside the response, what is the description you see?

https://<bitbucketBaseURL>/rest/build-status/latest/commits/<commitID>

 

Amulya Kota November 6, 2024

I am able to see the description I posted through POST request via the url you provided

but I can't see it in the UI

Capture6.JPGCapture5.JPG

 

Zuri Suwru
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2024

This means your script works perfectly fine, the issue isn't with your code.

Unfortunately though, the description field isn't really shown in BitBucket anymore (from what I've gathered trying to debug your case). In fact, the images you see, alongside the guide from your link above are all from 2017, on a way earlier version of BitBucket.

To change the message you see on the builds tab, you must update the message you commit/push with, not the build status description via POSTing.

Sorry for the letdown, hopefully you'll find an alternative way to achieve something similar for reporting/auditing.

Amulya Kota November 6, 2024

Alright, thank you for the information, I will find an alternative. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events