public ManiphestEdit maniphestEdit()

in src/main/java/com/googlesource/gerrit/plugins/its/phabricator/conduit/Conduit.java [89:128]


  public ManiphestEdit maniphestEdit(
      int taskId, String comment, String projectNameToAdd, String projectNameToRemove)
      throws ConduitException {
    ManiphestEdit result = null;
    List<Object> transactions = new ArrayList<>();

    if (!Strings.isNullOrEmpty(comment)) {
      HashMap<String, Object> transaction = new HashMap<>();
      transaction.put("type", ACTION_COMMENT);
      transaction.put("value", comment);

      transactions.add(transaction);
    }

    if (!Strings.isNullOrEmpty(projectNameToAdd)) {
      HashMap<String, Object> transaction = new HashMap<>();
      transaction.put("type", ACTION_PROJECT_ADD);
      transaction.put("value", ImmutableList.of(projectSearch(projectNameToAdd).getPhid()));

      transactions.add(transaction);
    }

    if (!Strings.isNullOrEmpty(projectNameToRemove)) {
      HashMap<String, Object> transaction = new HashMap<>();
      transaction.put("type", ACTION_PROJECT_REMOVE);
      transaction.put("value", ImmutableList.of(projectSearch(projectNameToRemove).getPhid()));

      transactions.add(transaction);
    }

    if (!transactions.isEmpty()) {
      HashMap<String, Object> params = new HashMap<>();
      params.put("objectIdentifier", taskId);
      params.put("transactions", transactions);
      JsonElement callResult = conduitConnection.call("maniphest.edit", params, token);
      result = gson.fromJson(callResult, ManiphestEdit.class);
    }

    return result;
  }