Prerequisite is, that the Bitbucket server is configured as Jira Application Link. In this case you do not need further authentication information.

Datasource

Datasource Type

REST Application Link

Datasource Application Link

Choose Bitbucket link

Datasource Test URL

/rest/api/1.0/projects/DEMO/repos
CODE

Query

Query URL

/rest/api/1.0/projects/:project/repos/
CODE

Converter

function convert(json) {
    var result = [];
    var parsedJsonObject = JSON.parse(json);
    var current, index;
    for (index in parsedJsonObject.values) {
        // only continue if this property is not inherited
        if (parsedJsonObject.hasOwnProperty(index)) {
            current = parsedJsonObject[index];
            result.push({
                'ID': current.id,
                'Name': current.name,
                'Slug': current.slug,
                'State': current.state,
                'Public': current.public
            });
        }
    }
    return result;
}
JS