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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can't update PR with API - used to work

Until recently, I had been able to automatically update PRs based upon information from an incoming webhook. It now no longers work. Malformed reviewer list? I mean, that's all well and good, but what about it is malformed? Code:

 

$ curl -X PUT -H "accept: application/json" -H "content-type: application/json" -snL https://api.bitbucket.org/2.0/repositories/twengg/chb0-deleteme/pullrequests/1 -d '{
"title": "Add a sample jenkinsfile",
"reviewers": [
{
"uuid": "{1492c667-c0c5-4a6c-bf48-496d9985df2d}"
},
{
"uuid": "{bc0329d8-c162-4e2f-b827-cddff42d1909}"
},
{
"uuid": "{0113c401-0b3c-4994-b905-07ddce749b15}"
}
]}'



gets me:

{
"type": "error",
"error": {
"fields": {
"reviewers": [
"Malformed reviewers list"
]
},
"message": "reviewers: Malformed reviewers list"
}
}
 

 

1 answer

1 accepted

0 votes
Answer accepted
Ben G Atlassian Team Jun 29, 2020

Hi @Christian Bongiorno sorry that API response error message isn't very helpful, I'll create a ticket to get that fixed up to show a more descriptive error message.

Looking at the list of users above, it appears that the third one is an account that's marked as "inactive" which is where the validation error is coming from.

Here's what the 2.0 Users API shows for that user:

GET https://api.bitbucket.org/2.0/users/%7B0113c401-0b3c-4994-b905-07ddce749b15%7D/?fields=display_name,account_status

{"account_status": "inactive", "display_name": "<redacted>"}

To unblock your integration for now, you could filter out any inactive accounts using the same 2.0 Users API. Not ideal for sure but hopefully that will keep things working for you.

As a longer term solution maybe - would you mind sharing which type of webhook you're receiving that users list from also? I can look into potentially filtering out inactive users from those webhook payloads - not guaranteed that will be possible yet, I'll need to see if it makes sense in the context of the webhook.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,738 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you