Hello everybody!
I have a need to periodically delete requests in JIRA. To do this, I use the Escalation Services module of the Script Runner plugin and the following code
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
try {
IssueManager issueManager = ComponentAccessor.getIssueManager()
ComponentAccessor.issueManager.deleteIssueNoEvent(issue as Issue)
} catch (Exception exception) {
log.warn("Exception" + exception.getMessage())
}
And requests are deleted without problems. But when executed, the following information is recorded in the logs, regardless of whether the try - catch block is used in the code or not
2022-04-01 11:56:17,586 ERROR [admin.EscalationService]: Escalation Service (Удаление запросов, если в запросе есть комментарий - Удалить) failed for issue 3-30
java.lang.Exception: Not attempting update. Errors: {}
Error Messages: [Вы не можете обновить пустой запрос.]
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.updateIssue(WorkflowUtils.groovy:259)
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils.updateIssue(WorkflowUtils.groovy)
at com.onresolve.scriptrunner.canned.jira.utils.WorkflowUtils$updateIssue$0.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.admin.EscalationService$_runService_closure4.doCall(EscalationService.groovy:420)
at com.onresolve.scriptrunner.canned.jira.admin.EscalationService.runService(EscalationService.groovy:386)
at com.onresolve.scriptrunner.canned.jira.admin.EscalationService.getDescription(EscalationService.groovy:342)
Tell me which exception needs to be handled so that errors do not appear in the logs?