public class Issue extends Resource
| Modifier and Type | Class and Description |
|---|---|
static class |
Issue.FluentCreate
Used to chain fields to a create action.
|
class |
Issue.FluentTransition
Used to chain fields to a transition action.
|
class |
Issue.FluentUpdate
Used to chain fields to an update action.
|
static class |
Issue.SearchResult
Issue search results structure.
|
apirev, DEFAULT_API_REV, id, restclient, self| Modifier | Constructor and Description |
|---|---|
protected |
Issue(RestClient restclient,
net.sf.json.JSONObject json)
Creates an issue from a JSON payload.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(File file)
Adds an attachment to this issue.
|
void |
addComment(String body)
Adds a comment to this issue.
|
void |
addComment(String body,
String visType,
String visName)
Adds a comment to this issue with limited visibility.
|
void |
addWatcher(String username)
Adds a watcher to the issue.
|
static Issue.FluentCreate |
create(RestClient restclient,
String project,
String issueType)
Creates a new JIRA issue.
|
Issue.FluentCreate |
createSubtask()
Creates a new sub-task.
|
void |
deleteWatcher(String username)
Removes a watcher to the issue.
|
static Issue |
get(RestClient restclient,
String key)
Retrieves the given issue record.
|
static Issue |
get(RestClient restclient,
String key,
String includedFields)
Retrieves the given issue record.
|
static Issue |
get(RestClient restclient,
String key,
String includedFields,
String expand)
Retrieves the given issue record.
|
List<WorkLog> |
getAllWorkLogs() |
User |
getAssignee() |
List<Attachment> |
getAttachments() |
ChangeLog |
getChangeLog() |
List<Comment> |
getComments() |
List<Component> |
getComponents() |
static net.sf.json.JSONObject |
getCreateMetadata(RestClient restclient,
String project,
String issueType) |
String |
getDescription() |
Date |
getDueDate() |
Object |
getField(String name)
Gets an arbitrary field by its name.
|
List<Version> |
getFixVersions() |
List<IssueLink> |
getIssueLinks() |
IssueType |
getIssueType() |
String |
getKey() |
List<String> |
getLabels() |
Issue |
getParent() |
Priority |
getPriority() |
Project |
getProject() |
User |
getReporter() |
Resolution |
getResolution() |
Date |
getResolutionDate() |
Status |
getStatus() |
List<Issue> |
getSubtasks() |
String |
getSummary() |
Integer |
getTimeEstimate() |
Integer |
getTimeSpent() |
TimeTracking |
getTimeTracking() |
List<Version> |
getVersions() |
Votes |
getVotes() |
Watches |
getWatches() |
List<WorkLog> |
getWorkLogs() |
void |
link(String issue,
String type)
Links this issue with another issue.
|
void |
link(String issue,
String type,
String body)
Links this issue with another issue and adds a comment.
|
void |
link(String issue,
String type,
String body,
String visType,
String visName)
Links this issue with another issue and adds a comment with limited visibility.
|
void |
refresh()
Reloads issue data from the JIRA server (issue includes all navigable
fields).
|
void |
refresh(String includedFields)
Reloads issue data from the JIRA server and specify which fields to
retrieve.
|
static Issue.SearchResult |
search(RestClient restclient,
String jql)
Search for issues with the given query.
|
static Issue.SearchResult |
search(RestClient restclient,
String jql,
String includedFields,
Integer maxResults)
Search for issues with the given query and specify which fields to
retrieve.
|
static Issue.SearchResult |
search(RestClient restclient,
String jql,
String includedFields,
Integer maxResults,
Integer startAt)
Search for issues with the given query and specify which fields to
retrieve.
|
String |
toString() |
Issue.FluentTransition |
transition()
Begins a transition field chain.
|
void |
unvote()
Removes the current user's vote from the issue.
|
Issue.FluentUpdate |
update()
Begins an update field chain.
|
void |
vote()
Casts a vote in favour of an issue.
|
protected Issue(RestClient restclient, net.sf.json.JSONObject json)
restclient - REST client instancejson - JSON payloadpublic static net.sf.json.JSONObject getCreateMetadata(RestClient restclient, String project, String issueType) throws JiraException
JiraExceptionpublic void addAttachment(File file) throws JiraException
file - java.io.FileJiraException - when the comment creation failspublic void addComment(String body) throws JiraException
body - Comment textJiraException - when the comment creation failspublic void addComment(String body, String visType, String visName) throws JiraException
body - Comment textvisType - Target audience type (role or group)visName - Name of the role or group to limit visibility toJiraException - when the comment creation failspublic void link(String issue, String type) throws JiraException
issue - Other issue keytype - Link type nameJiraException - when the link creation failspublic void link(String issue, String type, String body) throws JiraException
issue - Other issue keytype - Link type namebody - Comment textJiraException - when the link creation failspublic void link(String issue, String type, String body, String visType, String visName) throws JiraException
issue - Other issue keytype - Link type namebody - Comment textvisType - Target audience type (role or group)visName - Name of the role or group to limit visibility toJiraException - when the link creation failspublic static Issue.FluentCreate create(RestClient restclient, String project, String issueType) throws JiraException
restclient - REST client instanceproject - Key of the project to create the issue inissueType - Name of the issue type to createJiraException - when the client fails to retrieve issue metadatapublic Issue.FluentCreate createSubtask() throws JiraException
JiraException - when the client fails to retrieve issue metadatapublic static Issue get(RestClient restclient, String key) throws JiraException
restclient - REST client instancekey - Issue key (PROJECT-123)JiraException - when the retrieval failspublic static Issue get(RestClient restclient, String key, String includedFields) throws JiraException
restclient - REST client instancekey - Issue key (PROJECT-123)includedFields - Specifies which issue fields will be included in
the result.
JiraException - when the retrieval failspublic static Issue get(RestClient restclient, String key, String includedFields, String expand) throws JiraException
restclient - REST client instancekey - Issue key (PROJECT-123)includedFields - Specifies which issue fields will be included in
the result.
expand - fields to expand when obtaining the issueJiraException - when the retrieval failspublic static Issue.SearchResult search(RestClient restclient, String jql) throws JiraException
restclient - REST client instancejql - JQL statementJiraException - when the search failspublic static Issue.SearchResult search(RestClient restclient, String jql, String includedFields, Integer maxResults) throws JiraException
restclient - REST client instancejql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
JiraException - when the search failspublic static Issue.SearchResult search(RestClient restclient, String jql, String includedFields, Integer maxResults, Integer startAt) throws JiraException
startAt field to obtain all the results.restclient - REST client instancejql - JQL statementincludedFields - Specifies which issue fields will be included in
the result.
maxResults - if non-null, defines the maximum number of
results that can be returnedstartAt - if non-null, defines the first issue to
returnJiraException - when the search failspublic void refresh()
throws JiraException
JiraException - when the retrieval failspublic void refresh(String includedFields) throws JiraException
includedFields - Specifies which issue fields will be included in
the result.
JiraException - when the retrieval failspublic Object getField(String name)
name - Name of the field to retrievepublic Issue.FluentTransition transition() throws JiraException
JiraException - when the client fails to retrieve issue metadatapublic Issue.FluentUpdate update() throws JiraException
JiraException - when the client fails to retrieve issue metadatapublic void vote()
throws JiraException
JiraException - when the voting failspublic void unvote()
throws JiraException
JiraException - when the voting failspublic void addWatcher(String username) throws JiraException
username - Username of the watcher to addJiraException - when the operation failspublic void deleteWatcher(String username) throws JiraException
username - Username of the watcher to removeJiraException - when the operation failspublic ChangeLog getChangeLog()
public String getKey()
public User getAssignee()
public List<Attachment> getAttachments()
public String getDescription()
public Date getDueDate()
public IssueType getIssueType()
public Issue getParent()
public Priority getPriority()
public Project getProject()
public User getReporter()
public Resolution getResolution()
public Date getResolutionDate()
public Status getStatus()
public String getSummary()
public TimeTracking getTimeTracking()
public Votes getVotes()
public Watches getWatches()
public List<WorkLog> getAllWorkLogs() throws JiraException
JiraExceptionpublic Integer getTimeSpent()
public Integer getTimeEstimate()
Copyright © 2014. All Rights Reserved.