I am strugling with my code, where i need to connect to dev jira. I have a piece of code for it.
Also i coudn't find API for Jersey-client. So is there any way to connect jira using groovy scipt.
import com.atlassian.jira.rest.*; import java.net.URI; import java.net.URISyntaxException; import com.atlassian.jira.rest.client.api.JiraRestClient; import com.atlassian.jira.rest.client.internal.jersey.JerseyJiraRestClientFactory; import com.atlassian.jira.rest.client.*; public static void connectToJiraREST() { final JerseyJiraRestClientFactory factory = new JerseyJiraRestClientFactory(); URI jiraServerUri; try { jiraServerUri = new URI("https://devjira.addteq.com/"); //jiraServerUri = new URI("https://10.1.1.125:8080/"); restClient = factory.createWithBasicHttpAuthentication(jiraServerUri, "admin", "welcome"); issue = restClient.getIssueClient().getIssue(key, pm); } catch (URISyntaxException e) { e.printStackTrace(); }catch (RestClientException e) { e.printStackTrace(); } }
What problem are you having?
I can see two things right away.
1. You use an object called restClient on line 20. Where is that declared?
2. You use an object called pm on line 22. What is that? Where is it declared?
I think if you can answer those questions, you should be farther along towards getting your REST connection working.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.