The error you're encountering suggests an issue with setting the value for the custom field of type "drop-down list" (customfield_12426). It seems like the value you are trying to set (fixedInVersion) might not be recognized or is not in the correct format.
Here are a few things you can check and try:
Ensure Valid Option Value:
Make sure that the value you are trying to set for the drop-down list (fixedInVersion) is a valid option for that field. The value should match one of the available options exactly.
Use Option ID:
Custom fields of type "drop-down list" often have an underlying set of options with associated IDs. Instead of using the option's display value (fixedInVersion), try using its ID if you have access to it.
java
Copy code
if (Utility.notEmpty(fixedInVersionID)) {
issueBuilder.setFieldInput(new FieldInput("customfield_12426", ComplexIssueInputFieldValue.with("id", fixedInVersionID)));
}
Check Field Configuration:
Verify that the field configuration for the project allows the provided value. Sometimes, there might be specific configurations or restrictions on the field that prevent certain values.
Upgrade Library Version:
The version 5.2.0 of jira-rest-java-client-core might have some issues, and upgrading to a more recent version might resolve the problem. Check the Atlassian Maven Repository for the latest version and consider upgrading.
xml
Copy code
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>latest-version</version>
</dependency>
Check Jira Server Logs:
Examine the Jira server logs for more details on the error. The logs may provide additional information on why the provided value is not accepted.
Validate Field Input:
Before creating the issue, you can validate the field input to see if there are any issues with the values you are trying to set.
java code:
ValidationResult validationResult = restClient.getIssueClient().validateIssue(issueBuilder.build());
if (!validationResult.isValid()) {
System.out.println(validationResult.getErrorCollection());
}
Make sure to adapt the code snippets according to your application's context.
THANK YOU
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.