Hi!
First of all, excuse my english. It is not my native language.
I am trying to update a custom field, but everytime i testing it i get same error: “customfield=Specify a valid ‘id’ or ‘name’ for XXXXXX”. I have been looking for a possible solution but i found nothing. My code looks like this:
public Issue updateIssue(String keyOrId,List<Pair<String,Object>> customArgs){
IssueRestClient issueClient = this.restClient.getIssueClient();
Map<String, FieldInput>fieldMap = new HashMap<>();
String id;
IssueInputBuilder builder = new IssueInputBuilder();
if (customArgs!=null){
for(Pair<String,Object> arg :customArgs ){
id = arg.left();
if(id!=null){
builder.setFieldInput(new FieldInput(id, arg.right()));
fieldMap.put(id, new FieldInput(id, arg.right()));
}
}else{
LOGGER.info("Attribute '"+arg.left()+"' does not exist ");
}
}
}
IssueInput issueInput= builder.build();
IssueInput issueUpdated = new IssueInput(fieldMap,null);
try {
Promise<Void> result = issueClient.updateIssue(keyOrId, issueUpdated);
Void vacio = result.claim();
**//Here is where i get the exception**
LOGGER.info("Issue updated");
}catch (Exception e){
LOGGER.info(e.getMessage());
}
return getIssue(keyOrId);
}
As you can see, i tried with IssueInputBuilder and creating directly an IssueInput. I got same error. I thought that maybe is a value problem but i got issue debugging and saw what was a valid value. I wrote it correctly. SO i have no idea about what i am doing wrong or maybe is an API problem. I have something similar in python and works perfectly, but i need implement this in Java.
Ty so much!!!