Update "Date modified" using Scriptrunner Script Console (MutableIssue.setUpdated


I am currently trying to set the “Date modified” of an issue in Jira Server using the Script Console of Scriptrunner.

I use this code snippet:

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.UpdateIssueRequest
import java.sql.Timestamp

def issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject("EHB3XPRJ3-6")

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def dateCf = customFieldManager.getCustomFieldObjects(issue).find {it.name == "LAST_UPDATE_DATE"}
def dateCfVal = (Date)issue.getCustomFieldValue(dateCf)

issue.setUpdated(new Timestamp(dateCfVal.time))
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
issueManager.updateIssue(user, issue, UpdateIssueRequest.builder().build())

If I update the Due Date using issue.setDueDate(new Timestamp(dateCfVal.time)) it is working fine.
But if I run it with setUpdated for the “Date Modified” it is running without error but not changing anything.

Can somebody please help me with this?


from what I understand here:

It seems it isn’t really possible without changing it in the DB directly?