@@ -176,7 +176,7 @@ class BitbucketService {
176
176
"locked": false,
177
177
"reviewers": [${ reviewers ? reviewers.collect { "{\"user\": { \"name\": \"${it}\" }}" }.join(',') : ''} ]
178
178
}"""
179
- return withTokenCredentials { _ , token ->
179
+ return withTokenCredentials { username , token ->
180
180
def url = " ${ bitbucketUrl} /rest/api/1.0/projects/${ project} /repos/${ repo} /pull-requests"
181
181
return this . httpRequestService. asString(
182
182
HttpRequestService . HTTP_METHOD_POST ,
@@ -327,7 +327,8 @@ class BitbucketService {
327
327
payload + = " ]" +
328
328
" }"
329
329
try {
330
- def url = " ${ bitbucketUrl} /rest/insights/1.0/projects/${ project} /repos/${ repo} /commits/${ gitCommit} /reports/${ data.key} "
330
+ def url = " ${ bitbucketUrl} " +
331
+ " /rest/insights/1.0/projects/${ project} /repos/${ repo} /commits/${ gitCommit} /reports/${ data.key} "
331
332
this . httpRequestService. asString(
332
333
HttpRequestService . HTTP_METHOD_PUT ,
333
334
HttpRequestService . AUTHORIZATION_SCHEME_BEARER ,
@@ -429,11 +430,11 @@ class BitbucketService {
429
430
}
430
431
431
432
String getToken () {
432
- withTokenCredentials { username , token -> return token}
433
+ withTokenCredentials { username , token -> return token }
433
434
}
434
435
435
436
@NonCPS
436
- Map getCommitsForIntegrationBranch (String token , String repo , int limit , int nextPageStart ){
437
+ Map getCommitsForIntegrationBranch (String token , String repo , int limit , int nextPageStart ) {
437
438
String request = " ${ bitbucketUrl} /rest/api/1.0/projects/${ project} /repos/${ repo} /commits"
438
439
return queryRepo(token, request, limit, nextPageStart)
439
440
}
@@ -449,10 +450,10 @@ class BitbucketService {
449
450
private Map queryRepo (String token , String request , int limit , int nextPageStart ) {
450
451
Map<String , String > headers = buildHeaders(token)
451
452
def httpRequest = Unirest . get(request). headers(headers)
452
- if (limit> 0 ) {
453
+ if (limit > 0 ) {
453
454
httpRequest. queryString(" limit" , limit)
454
455
}
455
- if (nextPageStart> 0 ) {
456
+ if (nextPageStart > 0 ) {
456
457
httpRequest. queryString(" start" , nextPageStart)
457
458
}
458
459
def response = httpRequest. asString()
0 commit comments