I am able to retrieve the issues already available using the issueKey but I want to create the issue,here is the function I used :
public String createIssue(String projectKey, String issueSummary) {
IssueRestClient issueClient = this.jiraRestClient.getIssueClient();
IssueInput newIssue = new IssueInputBuilder(projectKey,1L,issueSummary).build();
Promise<BasicIssue> pIssue = null;
try{
pIssue= issueClient.createIssue(newIssue);
}
catch(Exception e){}
return pIssue.claim().getKey();
}
output :
com.atlassian.jira.rest.client.RestClientException: valid issue type is required
at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:165)
at com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient$2.apply(AbstractAsynchronousRestClient.java:159)
at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:48)
at com.atlassian.httpclient.api.ResponsePromiseMapFunction.apply(ResponsePromiseMapFunction.java:12)
at com.atlassian.util.concurrent.Promises$Of$3.apply(Promises.java:285)
at com.atlassian.util.concurrent.Promises$2.onSuccess(Promises.java:162)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:799)
ArrayList<IssueType> issueTypes = Lists.newArrayList(jiraClient.jiraRestClient.getMetadataClient().getIssueTypes().claim());
for ( IssueType issue : issueTypes){
System.out.println("Issue Name : " + issue.getName() + " , Issue ID : " + issue.getId());
}
The error message is pretty clear - you've not given it a valid issue type to create.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I tried to get the valid values of the issue types but unable to find them
can you suggest me some way to get valid values for all the issue types ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the "create meta" call to get a list of values - see https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-discovering-meta-data-for-creating-issues-6291669/ (I don't use the JRJC, so I don't know if it supports it. I found it just gets in the way of me using the API properly)
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.
This forum software often adds crud to the end of urls - remove everything from the first % onwards and try again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ArrayList<IssueType> issueTypes = Lists.newArrayList(jiraClient.jiraRestClient.getMetadataClient().getIssueTypes().claim());
for ( IssueType issue : issueTypes){
System.out.println("Issue Name : " + issue.getName() + " , Issue ID : " + issue.getId());
}
above provided code can be used to retrieve all the issues created in your
jira projects of your jira account
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.