jenkinsci / jenkinsci/java-client-api

QueueReference.getQueueItemUrlPart url issue

Open
#221 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
913
Forks
466
PR merge metrics
No merged PRs in 30d

Description

Due to TestCases, QueueReference generated by job.build() , and get url by ExtractHeader

`QueueReference qr = paramJob.build(param, true);`
`//ExtractHeader location = client.post(url + "buildWithParameters?" + qs, null,ExtractHeader.class, crumbFlag);`
`QueueItem qi = jksSrv.getQueueItem(qr);`

` String url = ref.getQueueItemUrlPart();`

`// "/queue/item/" + id`

`QueueItem queueItem = client.get(url, QueueItem.class);`

`queueItem.setClient(client);`

Jenkins API returns $domain/queue/item/$id while submit build req

but the API can't return valid response via $domain/queue/item/$id

then cause `QueueItem qi = jksSrv.getQueueItem(qr)` throw NPE

Should we add suffix in QueueReference ctor ?

![suffix](https://cloud.githubusercontent.com/assets/1091759/21496154/49f1f702-cc57-11e6-82c8-a113739b5bf7.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.