Skip to content

gitlab4j#1023 Add Field Iteration to Issue. #1027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/java/org/gitlab4j/api/models/AbstractIssue.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public String toString() {
private Integer mergeRequestsCount;
private Boolean hasTasks;
private String taskStatus;
private Iteration iteration;
private TaskCompletionStatus taskCompletionStatus;

public Assignee getAssignee() {
Expand Down Expand Up @@ -325,7 +326,15 @@ public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}

public TaskCompletionStatus getTaskCompletionStatus() {
public Iteration getIteration() {
return iteration;
}

public void setIteration(Iteration iteration) {
this.iteration = iteration;
}

public TaskCompletionStatus getTaskCompletionStatus() {
return taskCompletionStatus;
}

Expand Down
116 changes: 116 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Iteration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package org.gitlab4j.api.models;

import java.util.Date;

import org.gitlab4j.api.utils.JacksonJsonEnumHelper;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public class Iteration {
public enum IterationState {
Opened, Upcomming, Current, Closed;

private static JacksonJsonEnumHelper<IterationState> enumHelper = new JacksonJsonEnumHelper<>(IterationState.class, true, true);

@JsonCreator
public static IterationState forValue(String value) {
return enumHelper.forValue(value);
}

@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}

@Override
public String toString() {
return (enumHelper.toString(this));
}
}

private Long id;
private Long iid;
private Long sequence;
private Long groupId;
private String title;
private String descripion;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo: Should be description

private IterationState state;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private Date createdAt;
private Date updatedAt;
private Date startDate;
private Date dueDate;
private String webUrl;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getIid() {
return iid;
}
public void setIid(Long iid) {
this.iid = iid;
}
public Long getSequence() {
return sequence;
}
public void setSequence(Long sequence) {
this.sequence = sequence;
}
public Long getGroupId() {
return groupId;
}
public void setGroupId(Long groupId) {
this.groupId = groupId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescripion() {
return descripion;
}
public void setDescripion(String descripion) {
this.descripion = descripion;
}
public IterationState getState() {
return state;
}
public void setState(IterationState state) {
this.state = state;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
}