/** * Creates a custom field option from a JSON payload. * * @param restclient REST client instance * @param json JSON payload */ protected CustomFieldOption(RestClient restclient, JSONObject json) { super(restclient); if (json != null) deserialise(json); }
@Override public String toString() { return getValue(); }
/** * Retrieves the given custom field option record. * * @param restclient REST client instance * @param id Internal JIRA ID of the custom field option * * @return a custom field option instance * * @throws JiraException when the retrieval fails */ public static CustomFieldOption get(RestClient restclient, String id) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "customFieldOption/" + id); } catch (Exception ex) { throw new JiraException("Failed to retrieve custom field option " + id, ex); } if (!(result instanceof JSONObject)) throw new JiraException("JSON payload is malformed"); return new CustomFieldOption(restclient, (JSONObject)result); }
result = (T)new Component(restclient, (JSONObject)r); else if (type == CustomFieldOption.class) result = (T)new CustomFieldOption(restclient, (JSONObject)r); else if (type == Issue.class) result = (T)new Issue(restclient, (JSONObject)r);
/** * Retrieves the given custom field option record. * * @param restclient REST client instance * @param id Internal JIRA ID of the custom field option * * @return a custom field option instance * * @throws JiraException when the retrieval fails */ public static CustomFieldOption get(RestClient restclient, String id) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "customFieldOption/" + id); } catch (Exception ex) { throw new JiraException("Failed to retrieve custom field option " + id, ex); } if (!(result instanceof JSONObject)) throw new JiraException("JSON payload is malformed"); return new CustomFieldOption(restclient, (JSONObject)result); }
result = (T)new Component(restclient, (JSONObject)r); else if (type == CustomFieldOption.class) result = (T)new CustomFieldOption(restclient, (JSONObject)r); else if (type == Issue.class) result = (T)new Issue(restclient, (JSONObject)r);
/** * Creates a custom field option from a JSON payload. * * @param restclient REST client instance * @param json JSON payload */ protected CustomFieldOption(RestClient restclient, JSONObject json) { super(restclient); if (json != null) deserialise(json); }
@Override public String toString() { return getValue(); }