Old user in watcher field disturbs Escalation (ScriptRunner Escalation)

Dieter Guthmann
Contributor
February 14, 2025

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.

watcherfield.jpg

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

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

Hi @Dieter Guthmann 

Please clarify: What version of Jira and ScriptRunner you are currently using?

Please also share the Scripted Field code and configuration so I can review it and provide some feedback.

I am looking forward to your feedback.

Thank you and Kind regards,
Ram

Dieter Guthmann
Contributor
February 18, 2025

It's Jira 8.20.12 and Script runner 6.58.0

I know it's rather old, but we had some restructuring, so for a time period there was not money for updating... :/

No scripted field ins involved - our watcher field is a custom field:
watcherfield.jpg

The only script runner call is issueInputParameters.setComment() within an Escalation-Job.

Thank you for your efforts.

Dieter

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events