This is an example script on how to get information from Jira Health Check plugin.
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.customisers.PluginModule
@WithPlugin("com.atlassian.troubleshooting.plugin-jira")
import com.atlassian.troubleshooting.api.healthcheck.SupportHealthCheckSupplier
@PluginModule
SupportHealthCheckSupplier healthCheckSupplier
healthCheckSupplier.healthChecks*.check().findAll { !it.healthy }*.failureReason()