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

Examples of com.atlassian.jira.rest.client.api.domain.Field


    final Boolean orderable = jsonObject.getBoolean("orderable");
    final Boolean navigable = jsonObject.getBoolean("navigable");
    final Boolean searchable = jsonObject.getBoolean("searchable");
    final FieldType custom = jsonObject.getBoolean("custom") ? FieldType.CUSTOM : FieldType.JIRA;
    final FieldSchema schema = jsonObject.has("schema") ? schemaJsonParser.parse(jsonObject.getJSONObject("schema")) : null;
    return new Field(id, name, custom, orderable, navigable, searchable, schema);
  }
View Full Code Here


  @Rule
  public final ExpectedException expectedException = ExpectedException.none();

  @Test
  public void testParseValidSingleField() throws JSONException {
    final Field field = fieldJsonParser.parse(ResourceUtil.getJsonObjectFromResource("/json/field/valid-system-field.json"));
    final FieldSchema schema = new FieldSchema("status", null, "status", null, null);
    final Field expectedField = new Field("status", "Status", FieldType.JIRA, false, true, true, schema);
    assertEquals(expectedField, field);
  }
View Full Code Here

    assertEquals(expectedField, field);
  }

  @Test
  public void testParseValidCustomField() throws JSONException {
    final Field field = fieldJsonParser.parse(ResourceUtil.getJsonObjectFromResource("/json/field/valid-custom-field.json"));
    final FieldSchema schema = new FieldSchema("array", "string", null, "com.atlassian.jira.plugin.system.customfieldtypes:multiselect", 10000l);
    final Field expectedField = new Field("customfield_10000", "MultiSelect Custom IssueField", FieldType.CUSTOM, true, true, true, schema);
    assertEquals(expectedField, field);
  }
View Full Code Here

  public void testParseMultipleCustomFields() throws JSONException {
    JsonArrayParser<Iterable<Field>> fieldsParser = FieldJsonParser.createFieldsArrayParser();
    final Iterable<Field> fields = fieldsParser.parse(ResourceUtil.getJsonArrayFromResource("/json/field/valid-multiple-fields.json"));

    assertThat(fields, Matchers.hasItems(
        new Field("progress", "Progress", FieldType.JIRA, false, true, false,
            new FieldSchema("progress", null, "progress", null, null)),
        new Field("customfield_10000", "MultiSelect Custom IssueField", FieldType.CUSTOM, true, true, true,
            new FieldSchema("array", "string", null, "com.atlassian.jira.plugin.system.customfieldtypes:multiselect", 10000l)),
        new Field("thumbnail", "Images", FieldType.JIRA, false, true, false, null),
        new Field("issuekey", "Key", FieldType.JIRA, false, true, false, null),
        new Field("timetracking", "Time Tracking", FieldType.JIRA, true, false, true,
            new FieldSchema("timetracking", null, "timetracking", null, null)),
        new Field("components", "Component/s", FieldType.JIRA, true, true, true,
            new FieldSchema("array", "component", "components", null, null)),
        new Field("aggregatetimespent", "Σ Time Spent", FieldType.JIRA, false, true, false,
            new FieldSchema("number", null, "aggregatetimespent", null, null))
    ));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.Field

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.