IssueInputParameters.setDueDate() is not updating Due Date

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

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?

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

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.

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.

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
Community showcase
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

456 views 7 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you