How can i add multiple reviewers through api?

andrei414 March 16, 2020

I am able to set only one reviewer through rest api.

 

{
    "title": "Talking Nerdy",
    "description": "It’s a kludge, but put the tuple from the database in the cache.",
    "state": "OPEN",
    "open": true,
    "closed": false,
    "fromRef": {
        "id": "refs/heads/feature-ABC-123",
        "repository": {
            "slug": "my-repo",
            "name": null,
            "project": {
                "key": "PRJ"
            }
        }
    },
    "toRef": {
        "id": "refs/heads/master",
        "repository": {
            "slug": "my-repo",
            "name": null,
            "project": {
                "key": "PRJ"
            }
        }
    },
    "locked": false,
    "reviewers": [
        {
            "user": {
                "name": "charlie"
            }
        }
    ],
    "links": {
        "self": [
            null
        ]
    }
}

 

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 16, 2020

Hello @andrei414 ,

Welcome to the Community.

reviewers property is an array, but items should be references to a user, so they should contain either username or uuid property, like this:

"reviewers": [
{
"uuid": "{4ebe61bf-...-a368a41c78f6}"
},
{
"uuid": "{2ce53e84-...-fff39d658b49}"
}
]

or, if you know their usernames:

"reviewers": [
{
"username": "dpenkin"
},
{
"username": "..."
}
]

Hope this helps.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events