| | |
| | | public List<Change> changes;
|
| | |
|
| | | public IssueModel() {
|
| | | created = new Date((System.currentTimeMillis() / 1000) * 1000);
|
| | | // the first applied change set the date appropriately
|
| | | created = new Date(0);
|
| | |
|
| | | type = Type.Defect;
|
| | | status = Status.New;
|
| | |
| | | return attachment;
|
| | | }
|
| | |
|
| | | public List<Attachment> getAttachments() {
|
| | | List<Attachment> list = new ArrayList<Attachment>();
|
| | | for (Change change : changes) {
|
| | | if (change.hasAttachments()) {
|
| | | list.addAll(change.attachments);
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | public void applyChange(Change change) {
|
| | | if (changes.size() == 0) {
|
| | | // first change created the issue
|
| | | created = change.created;
|
| | | }
|
| | | changes.add(change);
|
| | |
|
| | | if (change.hasFieldChanges()) {
|