So here is the script. I omitted some code, but ideally this is how it is. My main issue is that when I run the "issueManager.updateIssue" function the issue's due date does not get updated. However in the history, it does say the change value was update.
Is this the proper to way to do this?
//manager to manage ineractions with issue
IssueManager issueManager = ComponentAccessor.issueManager
//user context of who is working on this ticket
ApplicationUser user = ComponentAccessor.getUserManager().getUserByKey("issuebot")
//the database view of an issue
Issue nonMutableIssue = event.getIssue()
MutableIssue mutableIssue = issueManager.getIssueObject(event.issue.getKey())
//print orignal dute date before change
//make the change
c.setTime(*SOME RANDOME TIME SET*)
String dateStr = (c.get(Calendar.MONTH) + 1) + "/" + c.get(Calendar.DAY_OF_MONTH) + "/" + c.get(Calendar.YEAR)
log.info TAG + "${mutableIssue.getKey()} due date set to: ${dateStr}"
mutableIssue.setDueDate(new Timestamp(c.getTimeInMillis()))
//updates the changes to the issue in the database
def updatedIssue = issueManager.updateIssue(user, mutableIssue, EventDispatchOption.ISSUE_UPDATED, false)
//run a reindex to get the latest changes made from the database
event.issue.reindex();