The user running Confluence / Jira etc must have the needed permissions on the filesystem to execute

def command = "/opt/confluence-home/scripts/GetAndUploadWeeklyIncidentReport.sh"
def proc = command.execute()
proc.waitFor()
return "Process exit code: ${proc.exitValue()}" + "Std Err: ${proc.err.text}" + "Std Out: ${proc.in.text}"