Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
2
-
Description
Summary
The source and target matcher fields are different between the GET and POST methods of the Default Reviewers REST APIs
GET methods use "sourceRefMatcher" and "targetRefMatcher" while POST methods use "sourceMatcher" and "targetMatcher".
Here's a sample response for a GET /rest/default-reviewers/1.0/projects/{projectKey}/conditions request:
[ { "id": 27, "scope": { "type": "PROJECT", "resourceId": 145 }, "sourceRefMatcher": { "active": true, "id": "ANY_REF_MATCHER_ID", "displayId": "ANY_REF_MATCHER_ID", "type": { "id": "ANY_REF", "name": "Any branch" } }, "targetRefMatcher": { "active": true, "id": "ANY_REF_MATCHER_ID", "displayId": "ANY_REF_MATCHER_ID", "type": { "id": "ANY_REF", "name": "Any branch" } }, "reviewers": [ { "name": "user1", "emailAddress": "user1@testdomain.com", "id": 51, "displayName": "User1", "active": true, "slug": "user1", "type": "NORMAL", "links": { "self": [ { "href": "https://bitbucket.myhost.com/users/user1" } ] } } ], "requiredApprovals": 1 } ]
Here's a sample request payload for a POST /rest/default-reviewers/1.0/projects/{projectKey}/condition request
{ "sourceMatcher": { "active": true, "id": "ANY_REF_MATCHER_ID", "displayId": "ANY_REF_MATCHER_ID", "type": { "id": "ANY_REF", "name": "Any branch" } }, "targetMatcher": { "active": true, "id": "ANY_REF_MATCHER_ID", "displayId": "ANY_REF_MATCHER_ID", "type": { "id": "ANY_REF", "name": "Any branch" } }, "reviewers": [ { "name": "user1", "emailAddress": "user1@testdomain.com", "id": 51, "displayName": "User1", "active": true, "slug": "user1", "type": "NORMAL" } ], "requiredApprovals": 1 }
The difference can cause confusion on the field names to pass in the POST methods, especially since the Default Reviewers REST resources documentation is currently missing examples (this doc issue is tracked in ticket: BSERV-12665)
Attachments
Issue Links
- is related to
-
BSERV-12665 Default Reviewers REST resources documentation missing examples
- Closed
- relates to
-
BSERV-12774 Support the specification of default reviewers as an array of usernames for the Default Reviewers APIs
- Gathering Interest
-
BSERV-12775 Support bulk creation of default reviewers pull request conditions through the Default Reviewers REST APIs
- Gathering Interest