Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aed8880

Browse filesBrowse files
committed
added a method to retrieve a single issue
1 parent bd58412 commit aed8880
Copy full SHA for aed8880

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed

‎src/main/java/org/kohsuke/github/GHRepository.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ public GHUser getOwner() throws IOException {
140140
return root.getUser(owner.login); // because 'owner' isn't fully populated
141141
}
142142

143+
public GHIssue getIssue(int id) throws IOException {
144+
return root.retrieve().to("/repos/" + owner.login + "/" + name + "/issues/" + id, GHIssue.class).wrap(this);
145+
}
146+
143147
public List<GHIssue> getIssues(GHIssueState state) throws IOException {
144148
return Arrays.asList(GHIssue.wrap(root.retrieve().to("/repos/" + owner.login + "/" + name + "/issues?state=" + state.toString().toLowerCase(), GHIssue[].class), this));
145149
}
@@ -333,7 +337,7 @@ public GHRepository fork() throws IOException {
333337
* Newly forked repository that belong to you.
334338
*/
335339
public GHRepository forkTo(GHOrganization org) throws IOException {
336-
new Requester(root).to(String.format("/repos/%s/%s/forks?org=%s",owner.login,name,org.getLogin()));
340+
new Requester(root).to(String.format("/repos/%s/%s/forks?org=%s", owner.login, name, org.getLogin()));
337341

338342
// this API is asynchronous. we need to wait for a bit
339343
for (int i=0; i<10; i++) {
@@ -476,7 +480,7 @@ public GHCommitStatus getLastCommitStatus(String sha1) throws IOException {
476480
*/
477481
public GHCommitStatus createCommitStatus(String sha1, GHCommitState state, String targetUrl, String description) throws IOException {
478482
return new Requester(root)
479-
.with("state",state.name().toLowerCase(Locale.ENGLISH))
483+
.with("state", state.name().toLowerCase(Locale.ENGLISH))
480484
.with("target_url", targetUrl)
481485
.with("description", description)
482486
.to(String.format("/repos/%s/%s/statuses/%s",owner.login,this.name,sha1),GHCommitStatus.class).wrapUp(root);
@@ -504,7 +508,7 @@ public GHHook createHook(String name, Map<String,String> config, Collection<GHEv
504508
}
505509

506510
return new Requester(root)
507-
.with("name",name)
511+
.with("name", name)
508512
.with("active", active)
509513
._with("config", config)
510514
._with("events",ea)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.