Package com.atlassian.jira.rest.client.domain

Examples of com.atlassian.jira.rest.client.domain.TimeTracking


        DateTime updateDate = null;
        DateTime dueDate = null;
        Collection<Version> affectedVersions = null;
        Collection<Version> fixVersions = null;
        Collection<BasicComponent> components = null;
        TimeTracking timeTracking = null;
        Collection<Field> fields = null;
        URI transitionsUri = null;
        Collection<IssueLink> issueLinks = null;
        BasicVotes votes = null;
        Collection<Worklog> worklogs = null;
View Full Code Here


  @Override
  public TimeTracking parse(JSONObject json) throws JSONException {
    final Integer originalEstimateMinutes = JsonParseUtil.parseOptionInteger(json, "originalEstimateSeconds");
    final Integer timeRemainingMinutes = JsonParseUtil.parseOptionInteger(json, "remainingEstimateSeconds");
    final Integer timeSpentMinutes = JsonParseUtil.parseOptionInteger(json, "timeSpentSeconds");
    return new TimeTracking(originalEstimateMinutes != null ? originalEstimateMinutes / 60 : null,
        timeRemainingMinutes != null ? timeRemainingMinutes / 60 : null,
        timeSpentMinutes != null ? timeSpentMinutes / 60 : null);
  }
View Full Code Here

  @Override
  public TimeTracking parse(JSONObject json) throws JSONException {
    final Integer originalEstimateMinutes = JsonParseUtil.parseOptionInteger(json, "timeoriginalestimate");
    final Integer timeRemainingMinutes = JsonParseUtil.parseOptionInteger(json, "timeestimate");
    final Integer timeSpentMinutes = JsonParseUtil.parseOptionInteger(json, "timespent");
    return new TimeTracking(originalEstimateMinutes, timeRemainingMinutes, timeSpentMinutes);
  }
View Full Code Here

public class TimeTrackingJsonParserTest {
  @Test
  public void testParse() throws Exception {
    final TimeTrackingJsonParser parser = new TimeTrackingJsonParser();
    final TimeTracking timeTracking = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/timeTracking/valid.json").getJSONObject("value"));
    assertEquals(new TimeTracking(1500, 70, 190), timeTracking);
  }
View Full Code Here

  }

  @Test
  public void testParseNoEstimation() throws Exception {
    final TimeTrackingJsonParser parser = new TimeTrackingJsonParser();
    final TimeTracking timeTracking = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/timeTracking/valid-no-estimation.json").getJSONObject("value"));
    assertEquals(new TimeTracking(null, 170, 9), timeTracking);
  }
View Full Code Here

  }

  @Test
  public void testParseJustLoggedTime() throws Exception {
    final TimeTrackingJsonParser parser = new TimeTrackingJsonParser();
    final TimeTracking timeTracking = parser.parse(ResourceUtil.getJsonObjectFromResource("/json/timeTracking/valid-just-timespent.json").getJSONObject("value"));
    assertEquals(new TimeTracking(null, null, 840), timeTracking);
  }
View Full Code Here

    // watchers
    final BasicWatchers watchers = issue.getWatchers();
    assertFalse(watchers.isWatching());
    assertEquals(toUri("http://localhost:8090/jira/rest/api/latest/issue/TST-2/watchers"), watchers.getSelf());
    assertEquals(1, watchers.getNumWatchers());
    assertEquals(new TimeTracking(0, 0, 145), issue.getTimeTracking());

    // attachments
    final Iterable<Attachment> attachments = issue.getAttachments();
    assertEquals(3, Iterables.size(attachments));
    final Attachment attachment = attachments.iterator().next();
View Full Code Here

    assertEquals(1.457, issue.getField("customfield_10000").getValue());
    assertThat(Iterables.transform(issue.getComponents(), new BasicComponentNameExtractionFunction()), containsInAnyOrder("Component A", "Component B"));
    assertEquals(2, Iterables.size(issue.getWorklogs()));
    assertEquals(1, issue.getWatchers().getNumWatchers());
    assertFalse(issue.getWatchers().isWatching());
    assertEquals(new TimeTracking(2700, 2220, 180), issue.getTimeTracking());

    assertEquals(Visibility.role("Developers"), issue.getWorklogs().iterator().next().getVisibility());
    assertEquals(Visibility.group("jira-users"), Iterables.get(issue.getWorklogs(), 1).getVisibility());

  }
View Full Code Here

    assertNull(issue.getField("customfield_10000").getValue());
    assertThat(issue.getComponents(), IsEmptyIterable.<BasicComponent>emptyIterable());
    assertEquals(2, Iterables.size(issue.getWorklogs()));
    assertEquals(0, issue.getWatchers().getNumWatchers());
    assertFalse(issue.getWatchers().isWatching());
    assertEquals(new TimeTracking(null, null, 840), issue.getTimeTracking());

    assertNull(issue.getWorklogs().iterator().next().getVisibility());
    assertNull(Iterables.get(issue.getWorklogs(), 1).getVisibility());
  }
View Full Code Here

      worklogs = parseOptionalArray(shouldUseNestedValueAttribute, s, new JsonWeakParserForJsonObject<Worklog>(worklogJsonParser), FIELDS, WORKLOG_FIELD.id);
    }

    final BasicWatchers watchers = getOptionalField(shouldUseNestedValueAttribute, s,
        isJira5x0OrNewer ? WATCHER_FIELD.id : WATCHER_PRE_5_0_FIELD.id, watchersJsonParser);
    final TimeTracking timeTracking = getOptionalField(shouldUseNestedValueAttribute, s, TIMETRACKING_FIELD.id,
        isJira5x0OrNewer ? new TimeTrackingJsonParserV5() : new TimeTrackingJsonParser());

    final Set<String> labels = Sets.newHashSet(parseOptionalArrayNotNullable(shouldUseNestedValueAttribute, s,
        jsonWeakParserForString, FIELDS, LABELS_FIELD.id));
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.domain.TimeTracking

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.