use of com.atlassian.jira.rest.client.api.JiraRestClient in project opennms by OpenNMS.
the class VerifyCommand method verifyConnection.
private JiraRestClient verifyConnection() {
final String host = config.getHost();
final String username = config.getUsername();
final String password = config.getPassword();
try {
System.out.println();
System.out.println("Try connecting to jira server " + host + " with username: '" + username + "' and password: '" + password + "'...");
final JiraRestClient connection = JiraConnectionFactory.createConnection(host, username, password);
final ServerInfo serverInfo = connection.getMetadataClient().getServerInfo().get();
System.out.println("Successfully connected to jira instance at " + host);
System.out.println("Server Info:" + serverInfo.toString());
System.out.println("OK");
return connection;
} catch (PluginException | InterruptedException | ExecutionException e) {
throw new RuntimeException("Could not connect to jira server", e);
}
}
use of com.atlassian.jira.rest.client.api.JiraRestClient in project opennms by OpenNMS.
the class VerifyCommand method doExecute.
@Override
protected Object doExecute() throws Exception {
JiraRestClient connection = null;
// Validate all settings
try {
System.out.println("Verifiing Jira Ticketer Plugin...");
validateConfiguration();
connection = verifyConnection();
validateProjectKey(connection);
validateIssueType(connection);
verifyCustomFields(connection);
return null;
} finally {
if (connection != null) {
connection.close();
}
}
}
Aggregations