public class Issue extends Resource
| Modifier and Type | Class and Description |
|---|---|
static class |
Issue.FluentCreate
Used to chain fields to a create action.
|
static class |
Issue.FluentRemoteLink
Used to
create remote links. |
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.NewAttachment |
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 |
addAttachments(Issue.NewAttachment... attachments)
Adds an attachments to this issue.
|
Comment |
addComment(String body)
Adds a comment to this issue.
|
Comment |
addComment(String body,
String visType,
String visName)
Adds a comment to this issue with limited visibility.
|
void |
addRemoteLink(String url,
String title,
String summary)
Adds a remote link to this issue.
|
void |
addWatcher(String username)
Adds a watcher to the issue.
|
WorkLog |
addWorkLog(String comment,
org.joda.time.DateTime startDate,
long timeSpentSeconds)
Adds
WorkLog to this issue |
static int |
count(RestClient restclient,
String jql)
count issues with the given query.
|
static Issue.FluentCreate |
create(RestClient restclient,
String project,
String issueType)
Creates a new JIRA issue.
|
Issue.FluentCreate |
createSubtask()
Creates a new sub-task.
|
boolean |
delete(boolean deleteSubtasks) |
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() |
Date |
getCreatedDate() |
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() |
List<RemoteLink> |
getRemoteLinks() |
User |
getReporter() |
Resolution |
getResolution() |
Date |
getResolutionDate() |
Security |
getSecurity() |
Status |
getStatus() |
List<Issue> |
getSubtasks() |
String |
getSummary() |
Integer |
getTimeEstimate() |
Integer |
getTimeSpent() |
TimeTracking |
getTimeTracking() |
List<Transition> |
getTransitions() |
Date |
getUpdatedDate() |
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.
|
Issue.FluentRemoteLink |
remoteLink()
Adds a remote link to this issue.
|
void |
removeAttachment(String attachmentId)
Removes an attachments.
|
static Issue.SearchResult |
search(RestClient restclient,
String jql,
String includedFields,
String expandFields,
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.
|
getApiRev, getAuthUri, getBaseUri, getId, getSelf, getUrl, setApiRevprotected Issue(RestClient restclient, net.sf.json.JSONObject json)
restclient - REST client instancejson - JSON payloadpublic static int count(RestClient restclient, String jql) throws JiraException
restclient - REST client instancejql - JQL statementJiraException - when the search failspublic static net.sf.json.JSONObject getCreateMetadata(RestClient restclient, String project, String issueType) throws JiraException
JiraExceptionpublic List<Transition> getTransitions() throws JiraException
JiraExceptionpublic void addAttachment(File file) throws JiraException
file - java.io.FileJiraException - when the attachment creation failspublic void addRemoteLink(String url, String title, String summary) throws JiraException
url - Url of the remote linktitle - Title of the remote linksummary - Summary of the remote linkJiraException - when the link creation failsremoteLink()public Issue.FluentRemoteLink remoteLink()
url or
globalId and
title before
creating the link.public void addAttachments(Issue.NewAttachment... attachments) throws JiraException
attachments - the attachments to addJiraException - when the attachments creation failspublic void removeAttachment(String attachmentId) throws JiraException
attachmentId - attachment id to removeJiraException - when the attachment removal failspublic Comment addComment(String body) throws JiraException
body - Comment textJiraException - when the comment creation failspublic Comment 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 WorkLog addWorkLog(String comment, org.joda.time.DateTime startDate, long timeSpentSeconds) throws JiraException
WorkLog to this issuecomment - provided commentstartDate - provided start datetimeSpentSeconds - provided time spent. This cannot be lower than 1m inuteJiraException - when worklog 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, String includedFields, String expandFields, 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
returnexpandFields - fields to expand when obtaining the issueJiraException - 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 List<RemoteLink> getRemoteLinks() throws JiraException
JiraExceptionpublic 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()
public Date getCreatedDate()
public Date getUpdatedDate()
public Security getSecurity()
public boolean delete(boolean deleteSubtasks)
throws JiraException
JiraExceptionCopyright © 2022. All rights reserved.