Hi!
Did someone ever manage to use QueryDslAccessor properly?
I have a custom REST endpoint with scriptrunner in Jira to import issues from another system.
A step I'm missing is to alter the updated date which can not be done with the IssueManager or any other obvious methods I'm aware of.
I read about QueryDslAccessor but it does not seem to update anything.
In this example I try to alter the summary. The real use-case is to alter the updated date. But even this is not working:
import com.atlassian.jira.database.QueryDslAccessor
import com.atlassian.jira.model.querydsl.QIssue
import com.atlassian.jira.component.ComponentAccessor
def issue = ComponentAccessor.IssueManager.getIssueObject("DET-12")
QueryDslAccessor queryDslAccessor = ComponentAccessor.getComponent(QueryDslAccessor.class);
QIssue qissue = QIssue.ISSUE
queryDslAccessor.execute(dbConnection -> {
dbConnection.update(QIssue.ISSUE)
.set(QIssue.ISSUE.summary, "Hello World")
.where(QIssue.ISSUE.key.eq(issue.key))
.execute();
});
I'm executing this in the Script Console just to test.
There is no error but when I look at that issue in the UI or in the database directly nothing changes.