Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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.
March 3, 2025

Hi @Dieter Guthmann

If you are using Jira 8.20.x, you can still install the latest version of ScriptRunner, i.e. 8.41.0.

I suggest that you either update the ScriptRunner version you are using using the Jira Plugin Manager or alternatively download the latest jar file from https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira/version-history and install it manually to update your ScriptRunner version.

I am suggesting the approach above because there have been many major fixes and new features added since the current version you are using.

Let me know how it goes.

Thank you and Kind regards,

Ram

 

Dieter Guthmann
Contributor
March 3, 2025

I've updated ScriptRunner to 8.41.0, but the Problem persists.

The error message also remains the same in principle:

2025-03-04 08:49:25,171 ERROR [jobs.EscalationService]: Escalation Service (Reminder für ABC-Projekt) failed for issue ABC-38
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:460)
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$_closure6$_closure7.doCall(EscalationService.groovy:156)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2$_closure6.doCall(EscalationService.groovy:134)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService$_execute_closure2$_closure6.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:132)
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:397)
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:394)
at com.onresolve.scriptrunner.runner.diag.DiagnosticsExecutionHandler$execute$3.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService.execute(EscalationService.groovy:130)
at com.onresolve.scriptrunner.canned.jira.jobs.EscalationService.execute(EscalationService.groovy)

 Have you other hints for me?

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.
March 4, 2025

Hi @Dieter Guthmann 

If you view the stacktrace, it is displaying this message:-

{customfield_10060=Users do not have permission to view this issue: tom}

What permission level does the user Tom have? Is this user a Jira Admin user?

Try to update the Escalation Service configuration and set it to a Jira Admin user and see if the error persists.

Let me know how it goes.

Thank you and Kind regards,
Ram

 

Dieter Guthmann
Contributor
March 4, 2025 edited

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

it doesn't change the problem
- if I run the Escalation service as a jira admin user
- check the Skip Permissions checkbox
grafik.png

'tom' is a user which hase been deactivated within the external user directory.
Its username is still listed within the watcher field (and watcher fields of many issues).
watcherfield = customfield_10060

Adding a comments manually to an issue isn't a problem. Adding the comment via issueInputParameters.setComment() leads to the problem described.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events