Hi,
For some reason (potential workaround for issue described here ) I would like to be able to change the "Time Logged" field.
I have been able to change the "Time Logged" field only via the MutableIssue.store() method, but neither by using the IssueManager.upateIssue() method nor the IssueService.update() method.
Obviously I do not want to use the MutableIssue.store() method because it has been deprecated.
Any hint?
MutableIssue.store() - Works
IssueManager issueManager = ComponentAccessor.getIssueManager()
MutableIssue issue = issueManager.getIssueObject("TASKTEST-315")
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
Long val = 3600 * 4
issue.setTimeSpent(val)
issue.store()
IssueService.update() - Does not work
IssueManager issueManager = ComponentAccessor.getIssueManager()
MutableIssue issue = issueManager.getIssueObject("TASKTEST-315")
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
IssueService issueService = ComponentAccessor.getIssueService()
Long val = 3600 * 4
IssueInputParameters inputParameters = issueService.newIssueInputParameters()
inputParameters.setTimeSpent((Long)(val/60))
IssueService.UpdateValidationResult validationResult = issueService.validateUpdate(user,issue.id,inputParameters)
issueService.update(user, validationResult)
IssueManger.updateIssue() - Does not work
IssueManager issueManager = ComponentAccessor.getIssueManager()
MutableIssue issue = issueManager.getIssueObject("TASKTEST-315")
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
Long val = 3600 * 4
issue.setTimeSpent(val)
issueManager.updateIssue(user,issue,EventDispatchOption.ISSUE_UPDATED,false)