pub struct IssueHandler<'octo> { }
Expand description
Handler for GitHub’s issue API.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request
key.
Created with Octocrab::issues
.
Gets an issue from the repository.
let issue = octocrab.issues("owner", "repo").get(3).await?;
Source
Create an issue in the repository.
let issue = octocrab.issues("owner", "repo").create("My first issue")
.body("This is an autogenerated issue..")
.milestone(1001)
.labels(vec![String::from("help-wanted")])
.assignees(vec![String::from("ferris")])
.send()
.await?;
Source
List issues in the repository.
use octocrab::params;
let issue = octocrab.issues("owner", "repo")
.list()
.state(params::State::All)
.milestone(1234)
.assignee("ferris")
.creator("octocrab")
.mentioned("octocat")
.labels(&[String::from("help wanted"), String::from("good first issue")])
.sort(params::issues::Sort::Comments)
.direction(params::Direction::Ascending)
.per_page(100)
.page(1u8)
.send()
.await?;
Source
Update an issue in the repository.
use octocrab::models;
let issue = octocrab.issues("owner", "repo")
.update(1234u64)
.title("Updated title")
.body("New body")
.state(models::IssueState::Closed)
.milestone(1234u64)
.assignees(&[String::from("ferris")])
.labels(&[String::from("help wanted"), String::from("good first issue")])
.send()
.await?;
Source Source Source§ Source
Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.
let issue = octocrab.issues("owner", "repo").add_assignees(101, &["username1", "username2"]).await?;
Source
Removes one or more assignees from an issue.
let issue = octocrab.issues("owner", "repo").remove_assignees(101, &["username1", "username2"]).await?;
Source
Checks if a user has permission to be assigned to an issue in the repository.
assert!(octocrab.issues("owner", "repo").check_assignee("ferris").await?);
Source
Lists the available assignees for issues in a repository.
let assignees = octocrab
.issues("owner", "repo")
.list_assignees()
.per_page(15)
.page(2u32)
.send()
.await?;
Source§ Source
Adds labels
to an issue.
let labels = octocrab::instance()
.issues("owner", "repo")
.add_labels(101, &[String::from("help wanted")])
.await?;
Source
Removes label
from an issue.
let removed_labels = octocrab::instance()
.issues("owner", "repo")
.remove_label(101, "my_label")
.await?;
Source
Replaces all labels for an issue.
let labels = octocrab::instance()
.issues("owner", "repo")
.replace_all_labels(101, &[String::from("help wanted")])
.await?;
Source
Creates a label in the repository.
let label = octocrab::instance()
.issues("owner", "repo")
.create_label("help wanted", "59dd5a", "")
.await?;
Source
Gets a label from the repository.
let label = octocrab::instance()
.issues("owner", "repo")
.get_label("help wanted")
.await?;
Source
Deletes a label in the repository.
let label = octocrab::instance()
.issues("owner", "repo")
.delete_label("help wanted")
.await?;
Source
List labels from an issue on a repository.
let page = octocrab::instance()
.issues("owner", "repo")
.list_labels_for_issue(404)
.per_page(20)
.page(2u32)
.send()
.await?;
Source
List all labels from a repository.
let page = octocrab::instance()
.issues("owner", "repo")
.list_labels_for_repo()
.per_page(20)
.page(2u32)
.send()
.await?;
Source§
Creates a comment in the issue.
let comment = octocrab::instance()
.issues("owner", "repo")
.create_comment(101, "Beep Boop")
.await?;
Gets a comment in the issue.
let comment = octocrab::instance()
.issues("owner", "repo")
.get_comment(101u64.into())
.await?;
Updates a comment in the issue.
let comment = octocrab::instance()
.issues("owner", "repo")
.update_comment(101u64.into(), "Beep Boop")
.await?;
Deletes a comment in an issue.
octocrab::instance().issues("owner", "repo").delete_comment(101u64.into()).await?;
Lists comments in the issue.
let comment = octocrab::instance()
.issues("owner", "repo")
.list_comments(101u64.into())
.since(chrono::Utc::now())
.per_page(100)
.page(2u32)
.send()
.await?;
Lists comments for issues in the whole repo.
let comment = octocrab::instance()
.issues("owner", "repo")
.list_issue_comments()
.per_page(100)
.page(2u32)
.send()
.await?;
Source§ Source
Lists events in the issue timeline.
let timeline = octocrab::instance()
.issues("owner", "repo")
.list_timeline_events(21u64.into())
.per_page(100)
.page(2u32)
.send()
.await?;
Source§ Source
Lists reactions for an issue.
let reactions = octocrab::instance()
.issues("owner", "repo")
.list_reactions(1)
.per_page(100)
.page(2u32)
.send()
.await?;
Lists reactions for an issue comment.
let reactions = octocrab::instance()
.issues("owner", "repo")
.list_comment_reactions(1)
.per_page(100)
.page(2u32)
.send()
.await?;
Source§ Source
Creates a reaction for an issue.
octocrab::instance()
.issues("owner", "repo")
.create_reaction(1, octocrab::models::reactions::ReactionContent::PlusOne)
.await?;
Creates a reaction for an issue comment.
octocrab::instance()
.issues("owner", "repo")
.create_comment_reaction(1, octocrab::models::reactions::ReactionContent::PlusOne)
.await?;
Source§ Source
Deletes a reaction for an issue.
octocrab::instance()
.issues("owner", "repo")
.delete_reaction(1, 1)
.await?;
Deletes a reaction for an issue comment.
octocrab::instance()
.issues("owner", "repo")
.delete_comment_reaction(1, 1)
.await?;
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4