Hi, I am creating a ticket for the first time using JiraRestClient. It works beautifully, and my code looks like this:
@PostConstruct
public void init() {
jiraRestClient = new AsynchronousJiraRestClientFactory()
.create(URI.create(jiraUrl), new BasicHttpAuthenticationHandler(jiraUser, jiraPassword));
}
// todo 작업중
public void createIssue(Long issueType, String issueSummary) {
IssueRestClient issueRestClient = jiraRestClient.getIssueClient();
IssueInput issueInput = new IssueInputBuilder()
.setFieldValue("customfield_10011", "Epic Name")
.setProjectKey(projectKey)
.setDescription(issueSummary)
.setSummary(issueSummary)
.setIssueType(new IssueType(null, 10000L, null, false, null, null))
.build();
issueRestClient.createIssue(issueInput).claim();
// return issueRestClient.createIssue(issueInput).claim().getKey();
}
In here, i don't know what is customfield_10011 and what means 10000L of IssueType.
Next is customization, so I need a document that is related to these fields. If you already have a document, would you give me the link address? Thank you.
Hi @윤현구
The L is just telling the code that the value is of type long.
I'm assuming that you got this code from somewhere else and didn't write it yourself. customfield_xxxxx is a way of representing a specific custom field in the API. To find the number for a custom field that you want to reference, in Jira go to the filters editor and start typing the name of the field. The dropdown will show you the cf number - see below
Does this answer your questions?
Thanks for your answer. @Warren
First, this code is written by myself.
The reason I added the customfield_xxxxx is in the previous error log.
```ErrorCollection = [errorCollection {status = 400, errors = {customfield_10011 = Epic Name is required.}, ErrorMessages = []}]}```
Second, I want to know what attribute id 10000 means. Is there a document or site defined for the index?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @윤현구
Right, I understand about the custom field now. What the message is saying is that the Epic Name is a required field when you create a ticket i.e. if you were using Jira's UI to create it, Epic Name appears on the Create screen and is mandatory. So what you've done in the code above is correct, although the value that you're setting it to is Epic Name.
If you've written the code, then you should know what the parameter of 10000 is for, I can't see the rest of your code so I have no idea what IssueInput and IssueType are.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Warren
IssueInput and IssueType is from Jira-Rest-Client-Core.
package path is
com.atlassian.jira.rest.client.api.domain.input.IssueInput;
and It is from my pom.xml like this
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>2.6.1</version>
</dependency>
Is it not yours?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, I don't use that, I use C# to connect directly to the API, so I'm afraid I won't be able to help you with that aspect
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.