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

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


  }

  private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException {
    final boolean required = json.getBoolean("required");
    final String name = JsonParseUtil.getOptionalString(json, "name");
    final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema"));
    final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations"));
    final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema);
    final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl");

    return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri);
View Full Code Here


  }

  private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException {
    final boolean required = json.getBoolean("required");
    final String name = JsonParseUtil.getOptionalString(json, "name");
    final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema"));
    final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations"));
    final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema);
    final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl");

    return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri);
View Full Code Here

    final String items = JsonParseUtil.getOptionalString(json, "items");
    final String system = JsonParseUtil.getOptionalString(json, "system");
    final String custom = JsonParseUtil.getOptionalString(json, "custom");
    final Long customId = JsonParseUtil.getOptionalLong(json, "customId");

    return new FieldSchema(type, items, system, custom, customId);
  }
View Full Code Here

  }

  private CimFieldInfo parseIssueFieldInfo(JSONObject json, String id) throws JSONException {
    final boolean required = json.getBoolean("required");
    final String name = JsonParseUtil.getOptionalString(json, "name");
    final FieldSchema schema = fieldSchemaJsonParser.parse(json.getJSONObject("schema"));
    final Set<StandardOperation> operations = parseOperations(json.getJSONArray("operations"));
    final Iterable<Object> allowedValues = parseAllowedValues(json.optJSONArray("allowedValues"), schema);
    final URI autoCompleteUri = JsonParseUtil.parseOptionalURI(json, "autoCompleteUrl");

    return new CimFieldInfo(id, required, name, schema, operations, allowedValues, autoCompleteUri);
View Full Code Here

    final String name = jsonObject.getString("name");
    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

  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

  }

  @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

    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.FieldSchema

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.