use of org.apache.xmlrpc.XmlRpcRequest in project intellij-community by JetBrains.
the class JiraIntegrationTest method createIssueViaXmlRpc.
@SuppressWarnings("UseOfObsoleteCollectionType")
@NotNull
private String createIssueViaXmlRpc(@NotNull String project, @NotNull String summary) throws Exception {
final URL url = new URL(myRepository.getUrl() + "/rpc/xmlrpc");
final XmlRpcClient xmlRpcClient = new XmlRpcClient(url);
final Map<String, Object> issue = new Hashtable<>();
issue.put("summary", summary);
issue.put("project", project);
issue.put("assignee", myRepository.getUsername());
// Bug
issue.put("type", 1);
// Open
issue.put("state", 1);
// empty token because of HTTP basic auth
final Vector<Object> params = new Vector<>(Arrays.asList("", issue));
final Hashtable result = (Hashtable) xmlRpcClient.execute(new XmlRpcRequest("jira1.createIssue", params), new CommonsXmlRpcTransport(url, myRepository.getHttpClient()));
return (String) result.get("key");
}
Aggregations