Add ID to WorklogEntryElement

Issue #609 resolved
Peter Lesty created an issue

When using the Jira Timesheet plugin for RAW json, it's sometimes helpful to get the workflow ID from the RESTful Endpoint so you can make changes to the particular entry. If this isn't included, then it's a bit of a workaround to actually discover the ID.

Easy fix is to change the WorklogEntryElement class to include an ID field like so:

public class WorklogEntryElement {

    @XmlElement public Long id;
    @XmlElement public String comment;
    @XmlElement public Long timeSpent;
    @XmlElement public String author;
    @XmlElement public String authorFullName;
    @XmlElement public Date created;
    @XmlElement public String groupLevel;
    @XmlElement public Date startDate;
    @XmlElement public String updateAuthor;
    @XmlElement public String updateAuthorFullName;
    @XmlElement public Date updated;

    // Required by JAXB
    @SuppressWarnings("unused")
    private WorklogEntryElement() {
    } 

    public WorklogEntryElement(Worklog worklog) {

        this.id = worklog.getId();
        this.author = worklog.getAuthor();
        this.authorFullName = worklog.getAuthorFullName();
        this.created = worklog.getCreated();
        this.groupLevel = worklog.getGroupLevel();
        this.comment = worklog.getComment();
        this.startDate = worklog.getStartDate();
        this.updateAuthor = worklog.getUpdateAuthor();
        this.updateAuthorFullName =  worklog.getUpdateAuthorFullName();
        this.timeSpent = worklog.getTimeSpent();
        this.updated = worklog.getUpdated();
    }
}

Comments (6)

  1. Log in to comment