IssueInputParameters.setDueDate() is not updating Due Date

Fahim May 21, 2013

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

3 answers

1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2013

The date should be exactly as it appears in the screen when you pick a date. Make sure the field is on the edit screen.

I am nto sure why you are not getting any errors. Maybe a bug in the version of JIRA you are using?

Fahim May 21, 2013

Hi,

Thanks for the quick reply.

The date display is exactly the same: dd/MMM/yy. The field is also on the edit screen.

I can try in development on another version of Jira, but the problem is that our production Jira instance is 5.2.8.

Thanks,
Fahim

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2013

Understood. It is just that I can't seen anything wrong with the code. Make sure you are trying as the same user and the user has "Schedule Issue" permissions. Can't think of anything else.

0 votes
Fahim May 21, 2013

I am using a fresh Jira instance that gets created from development (using atlas-run). Only one user admin/admin which belongs to jira-administrators, jira-developers, and jira-users. jira-developers have "Schedule Issue" rights.

I will use MutableIssue for now to set the duedate. If I figure anything else, I will write back.

Thanks a lot for your assistance.

0 votes
Fahim May 21, 2013

I am using a fresh Jira instance that gets created from development (using atlas-run). Only one user admin/admin which belongs to jira-administrators, jira-developers, and jira-users. jira-developers have "Schedule Issue" rights.

I will use MutableIssue for now to set the duedate. If I figure anything else, I will write back.

Thanks a lot for your assistance.

Suggest an answer

Log in or Sign up to answer