Class GHIssue

    • Constructor Detail

      • GHIssue

        public GHIssue()
    • Method Detail

      • getRepository

        public GHRepository getRepository()
        Repository to which the issue belongs.
        Returns:
        the repository
      • getBody

        public String getBody()
        The description of this pull request.
        Returns:
        the body
      • getNumber

        public int getNumber()
        ID.
        Returns:
        the number
      • getHtmlUrl

        public URL getHtmlUrl()
        The HTML page of this issue, like https://github.com/jenkinsci/jenkins/issues/100
        Specified by:
        getHtmlUrl in class GHObject
        Returns:
        URL of this object for humans, which renders some HTML.
      • getTitle

        public String getTitle()
        Gets title.
        Returns:
        the title
      • isLocked

        public boolean isLocked()
        Is locked boolean.
        Returns:
        the boolean
      • getState

        public GHIssueState getState()
        Gets state.
        Returns:
        the state
      • getClosedAt

        public Date getClosedAt()
        Gets closed at.
        Returns:
        the closed at
      • comment

        @WithBridgeMethods(void.class)
        public GHIssueComment comment​(String message)
                               throws IOException
        Updates the issue by adding a comment.
        Parameters:
        message - the message
        Returns:
        Newly posted comment.
        Throws:
        IOException - the io exception
      • setTitle

        public void setTitle​(String title)
                      throws IOException
        Sets title.
        Parameters:
        title - the title
        Throws:
        IOException - the io exception
      • setBody

        public void setBody​(String body)
                     throws IOException
        Sets body.
        Parameters:
        body - the body
        Throws:
        IOException - the io exception
      • setMilestone

        public void setMilestone​(GHMilestone milestone)
                          throws IOException
        Sets the milestone for this issue.
        Parameters:
        milestone - The milestone to assign this issue to. Use null to remove the milestone for this issue.
        Throws:
        IOException - The io exception
      • assignTo

        public void assignTo​(GHUser user)
                      throws IOException
        Assign to.
        Parameters:
        user - the user
        Throws:
        IOException - the io exception
      • setLabels

        public void setLabels​(String... labels)
                       throws IOException
        Sets labels.
        Parameters:
        labels - the labels
        Throws:
        IOException - the io exception
      • addLabels

        public void addLabels​(String... names)
                       throws IOException
        Adds labels to the issue.
        Parameters:
        names - Names of the label
        Throws:
        IOException - the io exception
      • addLabels

        public void addLabels​(GHLabel... labels)
                       throws IOException
        Add labels.
        Parameters:
        labels - the labels
        Throws:
        IOException - the io exception
      • removeLabels

        public void removeLabels​(String... names)
                          throws IOException
        Remove a given label by name from this issue.
        Parameters:
        names - the names
        Throws:
        IOException - the io exception
      • addAssignees

        public void addAssignees​(GHUser... assignees)
                          throws IOException
        Add assignees.
        Parameters:
        assignees - the assignees
        Throws:
        IOException - the io exception
      • setAssignees

        public void setAssignees​(GHUser... assignees)
                          throws IOException
        Sets assignees.
        Parameters:
        assignees - the assignees
        Throws:
        IOException - the io exception
      • removeAssignees

        public void removeAssignees​(GHUser... assignees)
                             throws IOException
        Remove assignees.
        Parameters:
        assignees - the assignees
        Throws:
        IOException - the io exception
      • removeAssignees

        public void removeAssignees​(Collection<GHUser> assignees)
                             throws IOException
        Remove assignees.
        Parameters:
        assignees - the assignees
        Throws:
        IOException - the io exception
      • getApiRoute

        protected String getApiRoute()
        Gets api route.
        Returns:
        the api route
      • getIssuesApiRoute

        protected String getIssuesApiRoute()
        Gets issues api route.
        Returns:
        the issues api route
      • getAssignees

        public List<GHUser> getAssignees()
        Gets assignees.
        Returns:
        the assignees
      • getUser

        public GHUser getUser()
                       throws IOException
        User who submitted the issue.
        Returns:
        the user
        Throws:
        IOException - the io exception
      • getClosedBy

        public GHUser getClosedBy()
                           throws IOException
        Reports who has closed the issue.

        Note that GitHub doesn't always seem to report this information even for an issue that's already closed. See https://github.com/kohsuke/github-api/issues/60.

        Returns:
        the closed by
        Throws:
        IOException - the io exception
      • getCommentsCount

        public int getCommentsCount()
        Gets comments count.
        Returns:
        the comments count
      • getPullRequest

        public GHIssue.PullRequest getPullRequest()
        Returns non-null if this issue is a shadow of a pull request.
        Returns:
        the pull request
      • isPullRequest

        public boolean isPullRequest()
        Is pull request boolean.
        Returns:
        the boolean
      • getMilestone

        public GHMilestone getMilestone()
        Gets milestone.
        Returns:
        the milestone