Hello there,
we're using Jira with Script runner with the escalation feature of script runner.
I now had to realize that my escalation service doesn't comment every issue the query is returning.
It turned out that the reason are users in the 'watcher fields' of some issues, which aren't in the company any more...
ERROR [jobs.EscalationService]: Escalation Service (Reminder für ABC-Projekt) failed for issue ABC-59 java.lang.Exception: Not attempting update. Errors: {customfield_10060=Users do not have permission to view this issue: tom} 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.$Proxy3989.accept(Unknown Source) at java_util_function_Consumer$accept$16.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:381) 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:378) at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$3.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)
So it semes that issueInputParameters.setComment()
does not add a comment, like an user would do - it behaves more like it edits the issue. If I add a comment as a regular user, it does not bother, if the watcher field contains user names of ones, who haven't jira access any more. Only if I edit an issue I have to take care that the watcher list is clean.
Do you have recommendations to fix that problem? Is there a better method in script runner to add a comment which doesn't validates the watcher field?
Checkbox 'Skip Permissions' doesn't change here anthing.
Dieter