I've just inherited a new instance of Jira Server, one of my users notified me that a job doesn't appear to have been running for a few weeks. Looking at the logs, I'm seeing the {reporter=The reporter specified is not a user.}, when I navigate to the issue(s) receiving the error, the reporter is an inactive user. I would expect this error on the creation of an issue, but not the update of an issue. We're currently running server version 8.2.4 and ScriptRunner Version 6.38.0. Below is the script that's producing the error. Any help would be appreciated.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.event.type.EventDispatchOption
// for all links of type "contains"
def linkManager = ComponentAccessor.getIssueLinkManager()
def links = linkManager.getOutwardLinks(issue.id)
.findAll { it.getLinkTypeId() == 10805}
.collect { it.getDestinationObject() }
if (links.size() == 0) return
// Custom fields to copy: "Requirements Document", "Design Memo", "FCCS", "SAS"
def requirementsDocumentField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(14110) as CustomField
def designMemoField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(14111) as CustomField
def FCCSField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(14112) as CustomField
def SASField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(14115) as CustomField
def cfList = [requirementsDocumentField, designMemoField, FCCSField, SASField]
if (links.size() > 1) {
// Return an error in the fields
for (field in cfList) {
field.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(field), 'Multiple issues linked as "contains"'), new DefaultIssueChangeHolder())
}
}
def issueService = ComponentAccessor.getIssueService()
def issueInputParams = issueService.newIssueInputParameters()
def user = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
def linkedIssue = links[0] as com.atlassian.jira.issue.Issue;
for (field in cfList) {
issueInputParams.addCustomFieldValue(field.id, linkedIssue.getCustomFieldValue(field))
// Reversed direction for push from DE MSP -> DESI -> IPTs
//issueInputParameters.addCustomFieldValue(field.id, issue.getCustomFieldValue(field))
/* Update without writing to history
field.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(field), linkedIssue.getCustomFieldValue(field)), new DefaultIssueChangeHolder())
// Reversed direction for push from DE MSP -> DESI -> IPTs
//field.updateValue(null, linkedIssue, new ModifiedValue(linkedIssue.getCustomFieldValue(field), issue.getCustomFieldValue(field)), new DefaultIssueChangeHolder())
*/
}
def update = issueService.validateUpdate(user, issue.id, issueInputParameters)
// Reversed direction for push from DE MSP -> DESI -> IPTs
//def update = issueService.validateUpdate(user, linkedIssue.id, issueInputParameters)
issueService.update(user, update, com.atlassian.jira.event.type.EventDispatchOption.DO_NOT_DISPATCH, false);
Here's the full error:
2022-02-18 07:47:12,826 ERROR [jobs.EscalationService]: Escalation Service (Roll up Document Numbers from linked DESI issues) failed for issue DESI-3174
java.lang.Exception: Not attempting update. Errors: {reporter=The reporter specified is not a user.}
Error Messages: []
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtil.updateIssue(WorkflowUtil.groovy:455)
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtil.updateIssue(WorkflowUtil.groovy)
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtil$updateIssue.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2$_closure5$_closure6.doCall(EscalationService.groovy:161)
at com.sun.proxy.$Proxy3261.accept(Unknown Source)
at java_util_function_Consumer$accept.call(Unknown Source)
at com.onresolve.jira.groovy.jql.AbstractPagerExecutor$_forEachInternal_closure2.doCall(AbstractPagerExecutor.groovy:68)
at com.onresolve.jira.groovy.jql.AbstractPagerExecutor.forEachInternal(AbstractPagerExecutor.groovy:67)
at com.onresolve.jira.groovy.jql.PagerExecutor.forEachIssue(PagerExecutor.groovy:26)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2$_closure5.doCall(EscalationService.groovy:137)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2$_closure5.doCall(EscalationService.groovy)
at com.onresolve.scriptrunner.jobs.JiraIdentitySwitchingService.switchIndentityAndExecuteInternal(JiraIdentitySwitchingService.groovy:45)
at com.onresolve.scriptrunner.jobs.JiraIdentitySwitchingService.executeAs(JiraIdentitySwitchingService.groovy:27)
at com.onresolve.scriptrunner.jobs.IdentitySwitchingService$executeAs.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2.doCall(EscalationService.groovy:135)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2.doCall(EscalationService.groovy)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsManagerImpl$DiagnosticsExecutionHandlerImpl$_execute_closure1.doCall(DiagnosticsManagerImpl.groovy:370)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsManagerImpl$DiagnosticsExecutionHandlerImpl$_execute_closure1.doCall(DiagnosticsManagerImpl.groovy)
at com.onresolve.scriptrunner.runner.ScriptExecutionRecorder.withRecording(ScriptExecutionRecorder.groovy:13)
at com.onresolve.scriptrunner.runner.ScriptExecutionRecorder$withRecording.call(Unknown Source)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsManagerImpl$DiagnosticsExecutionHandlerImpl.execute(DiagnosticsManagerImpl.groovy:368)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$2.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService.execute(EscalationService.groovy:133)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService.execute(EscalationService.groovy)