Forums

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

How to update only the description of a pull request using the REST API

CJCombrink October 17, 2024

We have Atlassian Bitbucket v8.19.4 (Data Center or Server, about does not tell me?)

We want to to update a description of a PR from Jenkins.

We can do this by using the Update pull request metadata endpoint by first getting all of the metadata and then updating the description and sending it back.


From the linked docs it is not clear what is the minimum fields to populate to just update the description.

 

If we only set the "description" field in the PUT, many other parts of the PR is updated, for example the reviewers are removed from the PR. 

Is there another way to only set only the 'description' without affect the PR in any other way or will we always have to request everything and send back everything unchanged except the changed description?

1 answer

0 votes
CJCombrink October 17, 2024

This is probably an XY problem
What we are doing is in Jenkins we host our UI PRs in docker containers.
We want to update the PR in bitbucket to add a link to the hosted website.

We have had success with adding the link as a comment after each build, but this is spammy and now try to add the link to the description if it is not already there (using some unique pattern, not fool proof but good enough)

Ideally we want to add link in the same way where SonarQube, JIRA and build links are, but from searching it looks like we will need a plugin for that. If that is not the case then any help in that regard will be useful. If we need a plugin we will go with the description on the PR since we are not planning on investing in developing or adding a plugin just for this, unless there is one with a good reputation that is free)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events