https://docs.atlassian.com/software/jira/docs/api/7.6.1/
I found above documentation for api - 7.6.1 version and in that documentation many packages are present so I didnt understand where to start in order to create issues in the project , create issues with custom fields ... etc
Previously I have used JiraRestClient to connect and create issues .
looking forward for help
with regards
Santosh PenjArla
Are you trying to create issues from outside Jira (i.e. another system using REST, like JRJC) or are you doing it internally, in an add-on (App) you are writing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.rest.client.IssueRestClient;
import com.atlassian.jira.rest.client.JiraRestClient;
import com.atlassian.jira.rest.client.domain.*;
import com.atlassian.jira.rest.client.domain.input.IssueInput;
import com.atlassian.jira.rest.client.domain.input.IssueInputBuilder;
import com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory;
import com.atlassian.util.concurrent.Promise;
import com.google.common.collect.Lists;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
public class MyJiraClient {
protected String userName;
protected String password;
protected String url;
protected JiraRestClient jiraRestClient;
public MyJiraClient(String user,String pass,String url){
this.userName = user;
this.password = pass;
this.url = url;
this.jiraRestClient = getJiraRestClient();
}
public URI getURI(){
return URI.create(this.url);
}
public JiraRestClient getJiraRestClient(){
JiraRestClient jiraRestClient;
jiraRestClient = null;
try{
jiraRestClient = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(getURI(),this.userName,this.password);
}
catch(Exception e){
System.out.println(e);
}
return jiraRestClient;
}
public String createIssue(String projectKey, String issueSummary) {
IssueRestClient issueClient = this.jiraRestClient.getIssueClient();
BasicProject basicProj = new BasicProject(this.getURI(),projectKey,issueSummary);
BasicIssueType issueType = new BasicIssueType(this.getURI(),10002L,"Task",false);
IssueInput newIssue = new IssueInputBuilder(basicProj,issueType,issueSummary).build();
try{
pIssue= issueClient.createIssue(newIssue);
}
catch(Exception e){}
return pIssue.claim().getKey();
}
public static void main(String[] args) throws URISyntaxException {
String userName = "username";
String password = "password";
String url = "https://myDomain.atlassian.net/";
MyJiraClient jiraClient = new MyJiraClient(userName, password, url);
String issueKey = jiraClient.createIssue("ABC", "abc");
}
}
above code successfully creates issues for me
now I want to use JIRA REST api 7.6 version and need help to start with it .
for example in the above code I have used
createWithBasicHttpAuthentication method
for connecting similar to that how can I connect in using this api 7.6
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hope you got what I am searching for
can you provide me with some guidance regarding this
Thanks in advance
with regards
SantoshPenjArla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Um, you have working code, so I'm not sure what you're looking for now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code which I shared is working but the thing is it is using jrjc-2.0.0-m2
now I want to use jira REST - 7.6
JiraRestClient is present in jrjc - 2.0.0-m2
but it is not there in jira Rest - 7.6
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so see https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/ - that will show you the authentication and possible calls you can make.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.