← ClaudeAtlas

scriptrunner-groovylisted

Use when a user asks to write, debug, refactor, or review a ScriptRunner Cloud Groovy script, or mentions HAPI, Issues.getByKey, Issues.create, listeners, script fields, jobs, escalation services, workflow post functions, conditions, validators, ComponentAccessor, or addComment in a Cloud context
serso-pt/scriptrunner-skills · ★ 0 · Code & Development · score 70
Install: claude install-skill serso-pt/scriptrunner-skills
# ScriptRunner Cloud Groovy Scripting ## Overview ScriptRunner Cloud uses the HAPI API (`com.adaptavist.hapi.cloud.jira.issues.Issues`) instead of Data Center's `ComponentAccessor`. Scripts are Groovy but with Cloud-specific patterns. Scripts referenced via `file:` in YAML get auto-imports; root-level scripts may need explicit imports. ## Quick Reference | API | Purpose | Features | |-----|---------|----------| | `Issues.getByKey(key)` | Fetch issue by key | All features | | `Issues.create(projectKey, type) { ... }` | Create issue with closure DSL | Jobs | | `issue.addComment(body)` | Add comment | Listeners, post functions | | `issue.subtasks` | Access subtask list | Escalation services | | `issue.getStatus().name` | Status name | Escalation services | | `issue.created.toZonedDateTime()` | Date field conversion | Script fields | | `Users.getLoggedInUser()` | Current user (`.accountId`) | Script Manager | | `get(path)`/`post(path)` | REST client (fluent builder, auto-auth) | All features | | `baseUrl` | Instance base URL (e.g. `https://mysite.atlassian.net`) | All features | | `logger.warn/info/debug/error` | Built-in logging | All features | ## HAPI APIs ### Issues.getByKey Use `Issues.getByKey(issue.key as String)` to get a full issue object. The `as String` cast is important because `issue.key` may be a GString. ```groovy import com.adaptavist.hapi.cloud.jira.issues.Issues def hapiIssue = Issues.getByKey(issue.key as String) def creator = hapiIssue.getCreator() ha