Using the following code to write a job to post notifications to Slack I am receiving an error I am not familiar with. Is there a better way to go about this? This code will eventually post notifications to a channel based on a filter for each result in the filter on scheduled intervals. The code is not complete but I am recieving the titled error after running it, although my initial test shows a working result. (Single issue)
I have not yet actually tested in the loop.
The error after run is:
StackOverflowError was thrown during script result serialization to JSON. This error is usually caused by attempt to serialize object graph with cycles. Please convert your script result to serializable object tree.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient
import groovyx.net.http.HttpResponseDecorator
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
log.setLevel(org.apache.log4j.Level.DEBUG)
final webhookPath = '/services/XXXXX' // it-jira-dev
final webhookBase = 'https://hooks.slack.com'
def jiraBaseUrl = ComponentAccessor.applicationProperties.getString(APKeys.JIRA_BASEURL)
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def query = jqlQueryParser.parseQuery("Key in (EDCO-117335)") //"Project = EDCO and Type = Escalation and 'Assigned Team' = 'Software Engineering' and resolution is empty and reporter in membersOf('jira-team-service_desk')")
def search = searchService.search(user, query, PagerFilter.getUnlimitedFilter())
log.debug("Total issues: ${search.total}")
search.results.each {documentIssue ->
log.debug(documentIssue.key)
def issue = issueManager.getIssueObject(documentIssue.id)
log.debug("${issue.key}")
//Issue detail augmentation
String summary = issue.summary
String textBlock = "${issue.issueType.name}: <$jiraBaseUrl/browse/$issue.key|${summary}>"
def body = [
text: summary,
blocks: [
[
type: 'section',
text: [
type: 'mrkdwn',
text: textBlock
]
]
]
]
def resp = new RESTClient(webhookBase).post(
path: webhookPath,
contentType: ContentType.HTML,
body: body,
requestContentType: ContentType.JSON
) as HttpResponseDecorator
assert resp.status == 200: "Request failed with status $resp.status. $resp.entity.content.text"
}

Thank you for any help on this!