public List<WorkLog> getAllWorkLogs() throws JiraException { JSONObject obj; try { URI uri = restclient.buildURI(getRestUri(key) + "/worklog"); JSON json = restclient.get(uri); obj = (JSONObject) json; } catch (Exception ex) { throw new JiraException("Failed to get worklog for issue " + key, ex); } return Field.getWorkLogs(obj, restclient); }
public List<RemoteLink> getRemoteLinks() throws JiraException { JSONArray obj; try { URI uri = restclient.buildURI(getRestUri(key) + "/remotelink"); JSON json = restclient.get(uri); obj = (JSONArray) json; } catch (Exception ex) { throw new JiraException("Failed to get remote links for issue " + key, ex); } return Field.getRemoteLinks(obj, restclient); }
/** * Removes the current user's vote from the issue. * * @throws JiraException when the voting fails */ public void unvote() throws JiraException { try { restclient.delete(getRestUri(key) + "/votes"); } catch (Exception ex) { throw new JiraException("Failed to unvote on issue " + key, ex); } }
public static Filter get(final RestClient restclient, final String id) throws JiraException { JSON result = null; try { URI uri = restclient.buildURI(getBaseUri() + "filter/" + id); result = restclient.get(uri); } catch (Exception ex) { throw new JiraException("Failed to retrieve filter with id " + id, ex); } if (!(result instanceof JSONObject)) { throw new JiraException("JSON payload is malformed"); } return new Filter(restclient, (JSONObject) result); }
/** * Creates a new sub-task. * * @return a fluent create instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentCreate createSubtask() throws JiraException { return Issue.create(restclient, getProject().getKey(), "Sub-task") .field(Field.PARENT, getKey()); }
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; }
/** * Casts a vote in favour of an issue. * * @throws JiraException when the voting fails */ public void vote() throws JiraException { try { restclient.post(getRestUri(key) + "/votes"); } catch (Exception ex) { throw new JiraException("Failed to vote on issue " + key, ex); } }
/** * Deletes this issue link record. * * @throws JiraException when the delete fails */ public void delete() throws JiraException { try { restclient.delete(getBaseUri() + "issueLink/" + id); } catch (Exception ex) { throw new JiraException("Failed to delete issue link " + id, ex); } }
public void logout(RestClient client) throws JiraException { if (token != null) { try { client.delete(Resource.getAuthUri() + "session"); } catch (Exception e) { throw new JiraException("Failed to logout", e); } } }
/** * Deletes a component from a project. * * @throws JiraException failed to delete the component */ public void delete() throws JiraException { try { restclient.delete(getRestUri(id)); } catch (Exception ex) { throw new JiraException("Failed to delete component " + id, ex); } } }
/** * Begins a transition field chain. * * @return a fluent transition instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentTransition transition() throws JiraException { return new FluentTransition(getTransitions()); }
/** * Begins an update field chain. * * @return a fluent update instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentUpdate update() throws JiraException { return new FluentUpdate(getEditMetadata()); }
/** * Adds a remote link to this issue. At least set the * {@link FluentRemoteLink#url(String) url} or * {@link FluentRemoteLink#globalId(String) globalId} and * {@link FluentRemoteLink#title(String) title} before * {@link FluentRemoteLink#create() creating} the link. * * @return a fluent remote link instance */ public FluentRemoteLink remoteLink() { return new FluentRemoteLink(restclient, getKey()); }
public List<WorkLog> getAllWorkLogs() throws JiraException { JSONObject obj; try { URI uri = restclient.buildURI(getRestUri(key) + "/worklog"); JSON json = restclient.get(uri); obj = (JSONObject) json; } catch (Exception ex) { throw new JiraException("Failed to get worklog for issue " + key, ex); } return Field.getWorkLogs(obj, restclient); }
/** * Creates a new sub-task. * * @return a fluent create instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentCreate createSubtask() throws JiraException { return Issue.create(restclient, getProject().getKey(), "Sub-task") .field(Field.PARENT, getKey()); }
/** * Removes the current user's vote from the issue. * * @throws JiraException when the voting fails */ public void unvote() throws JiraException { try { restclient.delete(getRestUri(key) + "/votes"); } catch (Exception ex) { throw new JiraException("Failed to unvote on issue " + key, ex); } }
/** * Casts a vote in favour of an issue. * * @throws JiraException when the voting fails */ public void vote() throws JiraException { try { restclient.post(getRestUri(key) + "/votes"); } catch (Exception ex) { throw new JiraException("Failed to vote on issue " + key, ex); } }
/** * Deletes this issue link record. * * @throws JiraException when the delete fails */ public void delete() throws JiraException { try { restclient.delete(getBaseUri() + "issueLink/" + id); } catch (Exception ex) { throw new JiraException("Failed to delete issue link " + id, ex); } }
/** * Begins a transition field chain. * * @return a fluent transition instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentTransition transition() throws JiraException { return new FluentTransition(getTransitions()); }
/** * Begins an update field chain. * * @return a fluent update instance * * @throws JiraException when the client fails to retrieve issue metadata */ public FluentUpdate update() throws JiraException { return new FluentUpdate(getEditMetadata()); }