private static String getRestUri(String key) { return getBaseUri() + "issue/" + (key != null ? key : ""); }
private static String getRestUri(String key) { return getBaseUri() + "issue/" + (key != null ? key : ""); }
private JSON getNextPortion(Issue issue, Integer startAt) throws URISyntaxException, RestException, IOException { Map<String, String> params = new HashMap<String, String>(); if (startAt != null) { params.put("startAt", String.valueOf(startAt)); } params.put("expand","changelog.fields"); URI uri = restclient.buildURI(Issue.getBaseUri() + "issue/" + issue.id, params); return restclient.get(uri); } }
URI searchUri = restclient.buildURI(getBaseUri() + "search", queryParams); return searchUri;
/** * Removes an attachments. * * @param attachmentId attachment id to remove * * @throws JiraException when the attachment removal fails */ public void removeAttachment(String attachmentId) throws JiraException { if (attachmentId == null) { throw new NullPointerException("attachmentId may not be null"); } try { restclient.delete(getBaseUri() + "attachment/" + attachmentId); } catch (Exception ex) { throw new JiraException("Failed remove attachment " + attachmentId, ex); } }
public boolean delete(final boolean deleteSubtasks) throws JiraException { boolean result; try { URI uri = restclient.buildURI(getBaseUri() + "issue/" + this.key, new HashMap<String, String>() {{ put("deleteSubtasks", String.valueOf(deleteSubtasks)); }}); result = (restclient.delete(uri) == null); } catch (Exception ex) { throw new JiraException("Failed to delete issue " + key, ex); } return result; }
/** * count issues with the given query. * * @param restclient REST client instance * * @param jql JQL statement * * @return the count * * @throws JiraException when the search fails */ public static int count(RestClient restclient, String jql) throws JiraException { final String j = jql; JSON result = null; try { Map<String, String> queryParams = new HashMap<String, String>(); queryParams.put("jql", j); queryParams.put("maxResults", "1"); URI searchUri = restclient.buildURI(getBaseUri() + "search", queryParams); result = restclient.get(searchUri); } catch (Exception ex) { throw new JiraException("Failed to search issues", ex); } if (!(result instanceof JSONObject)) { throw new JiraException("JSON payload is malformed"); } Map map = (Map) result; return Field.getInteger(map.get("total")); }
private static JSONObject realGet(RestClient restclient, String key, Map<String, String> queryParams) throws JiraException { JSON result = null; try { URI uri = restclient.buildURI(getBaseUri() + "issue/" + key, queryParams); result = restclient.get(uri); } catch (Exception ex) { throw new JiraException("Failed to retrieve issue " + key, ex); } if (!(result instanceof JSONObject)) { throw new JiraException("JSON payload is malformed"); } return (JSONObject) result; }
private static JSONObject realGet(RestClient restclient, String key, Map<String, String> queryParams) throws JiraException { JSON result = null; try { URI uri = restclient.buildURI(getBaseUri() + "issue/" + key, queryParams); result = restclient.get(uri); } catch (Exception ex) { throw new JiraException("Failed to retrieve issue " + key, ex); } if (!(result instanceof JSONObject)) { throw new JiraException("JSON payload is malformed"); } return (JSONObject) result; }
params.put("issuetypeNames", itval); URI createuri = restclient.buildURI( getBaseUri() + "issue/createmeta", params); result = restclient.get(createuri);
URI searchUri = restclient.buildURI(getBaseUri() + "search", queryParams); result = restclient.get(searchUri); } catch (Exception ex) {
getBaseUri() + "issue/createmeta", new HashMap<String, String>() {{ put("expand", "projects.issuetypes.fields");
restclient.post(getBaseUri() + "issueLink", req); } catch (Exception ex) { throw new JiraException("Failed to link issue " + key + " with issue " + issue, ex);
restclient.post(getBaseUri() + "issueLink", req); } catch (Exception ex) { throw new JiraException("Failed to link issue " + key + " with issue " + issue, ex);