Guide · Jira
Approval Flow with ScriptRunner for Jira Cloud: read approval status in scripts
Approval Flow for Jira 3.0.0 is the production version (30 October 2026). Last updated 29 October 2026. On the Atlassian Marketplace.
By Bartosz Stankiewicz, founder, Stanki Guild.
Approval Flow keeps its state inside your Jira site and exposes it the way Jira exposes any app data: an issue property and JQL fields. ScriptRunner for Jira Cloud reads both through Jira's REST API, as the user or the ScriptRunner add-on user, so scripts never need anything from us. Decisions stay in Jira: a script can read the approval status, never sign off for a person.
The examples are starting points. ScriptRunner's helpers and Jira's expression syntax change over time, so run each one on a test project before you rely on it.
What you can read
#The issue property com.stankiguild.approvalflow.status, on every work item that has had an approval change:
| Field | Meaning |
|---|---|
status | none, pending, approved or rejected |
approved, required | sign-offs given and sign-offs the gate needs |
pendingFor | account IDs of named approvers who still have to act |
dueAt | earliest due date of an open sign-off, only when there is one |
blocking, blockingCount | up to 5 requirements that still block the gate (text and "rejected" or "waiting"), and how many there are |
chainHead | the head of the work item's audit log: block number and SHA-256 |
JQL fields: approvalStatus, approvalApproved, approvalRequired, approvalPendingFor (a user) and approvalDue (a date).
The Approval status field ("2/3 approved"), once your Jira administrator adds it to a screen (every edition).
The property is written after every approval change, so it can lag a moment behind the panel; the panel and the validator always read the record itself. A work item gets the property at its first approval change.
Example 1: list work items in a release still waiting for sign-off (script console)
#def jql = 'project = ABC AND fixVersion = "1.4" AND approvalStatus in ("pending", "rejected")'
def res = get('/rest/api/3/search/jql').queryString('jql', jql).queryString('fields', 'summary').asObject(Map)
res.body.issues.collect { "${it.key}: ${it.fields.summary}" }.join('\n')
Example 2: a workflow condition or validator (Jira expression, no Groovy)
#Hide or block a transition until Approval Flow says approved:
issue.properties.get('com.stankiguild.approvalflow.status') != null
&& issue.properties.get('com.stankiguild.approvalflow.status').status == 'approved'
Approval Flow's own Approval sign-off required validator already does this with clearer messages, and its transition gates (paid) add your own Jira expressions to it. Use a ScriptRunner expression when you combine the status with logic of your own.
Example 3: comment when a work item becomes fully approved (listener on Issue Updated)
#def key = issue.key
def prop = get("/rest/api/3/issue/${key}/properties/com.stankiguild.approvalflow.status").asObject(Map)
if (prop.status == 200 && prop.body.value?.status == 'approved') {
post("/rest/api/3/issue/${key}/comment")
.header('Content-Type', 'application/json')
.body([body: [type: 'doc', version: 1, content: [[type: 'paragraph', content: [[type: 'text', text: 'All sign-offs are in.']]]]]])
.asString()
}
Changing approvals from a script
#There is no write path through the property: it is overwritten after each change. To add requirements or approvers, set due dates or stages, or apply a policy from a rule, use Approval Flow's Jira Automation actions. No action, and no script, can approve or reject for a person.
How our app helps
#Approval Flow is our app: required sign-offs on Jira work items with named approvers, quorum, separation of duties and a workflow validator, with a hash-chained audit trail. Pricing: free for up to 10 users with every feature, then from USD 0.90 per user per month for the first 100 users. See the documentation.
Common questions
#Can a ScriptRunner script approve a work item?
No. Sign-offs are recorded only for the signed-in approver in the panel or on My approvals. Scripts and Automation rules can read the status and change the setup, never decide.
Does a missing property mean "not approved"?
It means no data yet: the work item has had no approval change since Approval Flow was installed. Treat it as not approved in a gate, and as unknown in a report.
Related
#- Approval Flow for Jira documentation
- Jira approval templates
- Approval Flow compared with other Jira apps
- Jira sign off: how to require a sign-off before a work item moves on
- Multiple approvers in Jira without Jira Service Management: 3 ways compared
- Which Jira and Confluence plans include approvals
- Jira approval workflow example: a purchase approval with three spend tiers
- Jira approval step skips the workflow validator: what you can do
- Jira: require a comment when someone approves or declines
- Jira approval: 50% plus one when the approver group keeps changing
- Jira approvals when the approver is out of office
- Jira approval reminders that repeat until the approver acts
- Release approval in Jira: what exists before a version is released
- Jira release approval process: how to record who approved a release and when
- Is a Slack approval valid audit evidence? What to record in Jira instead
- ISO 27001 change management evidence in Jira: what to keep for Annex A 8.32
- NIS2 and change control in Jira: what to record
- Jira approvals in Slack, Microsoft Teams and e-mail, without losing who decided
- How we test approval rules in Jira: a million random cases a night
- Our nightly tests went red on the first run. The app was right.