public List<User> getAssignableUsers() throws JiraException { JSON result = null; try { Map<String, String> queryParams = new HashMap<String, String>(); queryParams.put("project", this.key); URI searchUri = restclient.buildURI(getBaseUri() + "user/assignable/search", queryParams); result = restclient.get(searchUri); } catch (Exception ex) { throw new JiraException("Failed to retrieve assignable users", ex); } if (!(result instanceof JSONArray)) throw new JiraException("JSON payload is malformed"); return Field.getResourceArray(User.class, result, restclient); }
/** * Retrieves all project records visible to the session user. * * @param restclient REST client instance * * @return a list of projects * * @throws JiraException when the retrieval fails */ public static List<Project> getAll(RestClient restclient) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "project"); } catch (Exception ex) { throw new JiraException("Failed to retrieve projects", ex); } if (!(result instanceof JSONArray)) throw new JiraException("JSON payload is malformed"); return Field.getResourceArray(Project.class, result, restclient); }
/** * Retrieves all project records visible to the session user. * * @param restclient REST client instance * * @return a list of projects * * @throws JiraException when the retrieval fails */ public static List<Project> getAll(RestClient restclient) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "project"); } catch (Exception ex) { throw new JiraException("Failed to retrieve projects", ex); } if (!(result instanceof JSONArray)) throw new JiraException("JSON payload is malformed"); return Field.getResourceArray(Project.class, result, restclient); }
/** * Retrieves the given project record. * * @param restclient REST client instance * @param key Project key * * @return a project instance * * @throws JiraException when the retrieval fails */ public static Project get(RestClient restclient, String key) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "project/" + key); } catch (Exception ex) { throw new JiraException("Failed to retrieve project " + key, ex); } if (!(result instanceof JSONObject)) throw new JiraException("JSON payload is malformed"); return new Project(restclient, (JSONObject)result); }
/** * Retrieves the given project record. * * @param restclient REST client instance * @param key Project key * * @return a project instance * * @throws JiraException when the retrieval fails */ public static Project get(RestClient restclient, String key) throws JiraException { JSON result = null; try { result = restclient.get(getBaseUri() + "project/" + key); } catch (Exception ex) { throw new JiraException("Failed to retrieve project " + key, ex); } if (!(result instanceof JSONObject)) throw new JiraException("JSON payload is malformed"); return new Project(restclient, (JSONObject)result); }