Hi,
I m trying to update the Due Date of an issue using IssueService component (validateUpdate() then update()). However it does not seem to change. If I try to update other fields (like summary, description, reported by...) these work correctly. It may be something simple that I missed.
[Jira version: 5.2.8]
Code snippet to capture due date change only:
String serviceAccountName = "admin";
User serviceUser = ComponentAccessor.getUserManager().getUserObject(serviceAccountName);
IssueService issueService = ComponentAccessor.getIssueService();
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
issueInputParameters.setDueDate("10/May/13");
UpdateValidationResult updateValidationResult = issueService.validateUpdate(serviceUser, 10000L, issueInputParameters);
if(updateValidationResult.isValid()){
IssueResult updateResult = issueService.update(serviceUser, updateValidationResult);
if (!updateResult.isValid())
{
//log errors
}
}
else
{
//log errors
}
I have checked for errors, but no errors are received.
I have checked the date format in Jira (Administration->System ->User Interface->Looks and..->Date/Time Formats: dd/MMM/yy for Day/Month/Year format. So, it should confirm with "10/May/13"
I have checked the updateValidationResult.getIssue to see the values of the new mutableIssue created but this does not have the due date. Neither it is found in the Map updateValidationResult.getFieldValuesHolder().
Using mutableIssue to set the due date works, but it is recommended to use IssueService.
It seems the setting of due date is ignored, even if i put value "abc" for due date, I still get no errors.
What do you think the problem is ? Any ideas are welcomed.
Thanks for your help,
Fahim