Jira
This plugin for the compliance-framework evaluates Jira and Jira Service Management (JSM) data to ensure Change Request processes are properly followed prior to new deployments.
This page is for operators who run the plugin-jira plugin with the CCF Agent, and for developers who write policies for it. It documents v0.2.5 and is generated from the plugin's README at v0.2.5.
How it works
Usage
The plugin implements the Runner interface and is executed by the compliance agent.
# Example execution (internal to framework)
./plugin-jira --config config.json
Requirements
Setup Instructions
1. Authentication Setup
The plugin supports two authentication methods:
Option A: Service Account + OAuth2 (Recommended for Cloud)
This method uses Jira's OAuth 2.0 (3LO) for apps or more specifically, for service-to-service integrations, you typically use API Tokens with a Service Account or OAuth 2.0 Client Credentials (if available for your organization).
How to set up a Service Account:
- Create a dedicated Atlassian account (e.g.,
compliance-bot@yourcompany.com). - Invite this account to your Jira instance.
- Follow Atlassian's guide on Service Accounts.
Option B: API Token (Fallback)
- Log in to Jira as the Service Account.
- Go to Account Settings > Security > API Tokens.
- Create a new API token and save it securely.
2. Minimal Permissions (Scopes)
The Service Account needs the following minimal permissions to collect compliance data:
- Global Permissions:
Browse Users(to see approvers and authors)
- Project Permissions (for all target projects):
Browse ProjectsView Development Tools(for Software API dev links)Administer Projects(optional, for detailed workflow/scheme inspection)
- OAuth Scopes (Cloud):
read:jira-workread:jira-userread:servicedesk-requestmanage:jira-configuration(for workflows and schemes)
Configuration
The plugin is configured via the PluginConfig structure:
| Parameter | Description |
|---|---|
base_url | The URL of your Jira instance (e.g., https://your-domain.atlassian.net) |
auth_type | oauth2 or token |
client_id | OAuth2 Client ID (for oauth2 auth) |
client_secret | OAuth2 Client Secret (for oauth2 auth) |
api_token | API Token (for token auth) |
user_email | Service Account email (for token auth) |
project_keys | Comma-separated list of Project Keys to monitor |
policy_labels | JSON map of labels to attach to generated evidence |
Policy data
Any policy_data set on this plugin's block in the agent configuration is passed
to every policy evaluation and is available to Rego as data.<key>. Which keys
are read depends on the policy bundle; for example:
plugins:
jira:
# ...source, policies and config as usual...
policy_data:
approver_groups:
- change-advisory-board
Evidence collected
Features
- Authentication: Supports OAuth2 (2-Legged OAuth / Client Credentials) and API Tokens.
- Data Collection:
- Jira Platform: Projects, Workflows, Schemes, Issue Types, Custom Fields, Audit Records, and Permissions.
- Jira Service Management: Native Approvals and SLAs.
- Jira Software: Development Information (GitHub PRs/commits) and Deployment events.
- Policy Evaluation: Integration with OPA policies to calculate compliance evidence based on collected Jira metadata.
Policy input
The plugin evaluates one kind of resource, a Jira project, and a policy receives one document per project as input. The document always has a projects array with exactly one entry, the project being evaluated, next to the Jira-wide global_permissions and audit_records, which are the same for every project. Fields are listed by their path inside the document; a field marked as left out is missing from the document, not null, so test for it with object.get or a default. Only open issues are included (status category To Do or In Progress, or no status category), and only for the issue types the plugin searches for, which are set by change_request_issue_types (Change Request and Change by default). Projects can be limited with project_keys. Reads that fail are logged and skipped, so any of the lists can also be missing because Jira did not return it.
| Field | Type | Description |
|---|---|---|
projects | array of objects | One entry, the project being evaluated. The fields below are inside it. |
projects[].project | object | The Jira project. |
projects[].project.id | string | Numeric ID of the project, as a string. |
projects[].project.key | string | Project key, for example PAY. |
projects[].project.name | string | Project display name. |
projects[].project.self | string | API URL of the project. Left out when empty. |
projects[].project.description | string | Project description. Left out when empty. |
projects[].project.style | string | classic or next-gen. Left out when empty. |
projects[].project.simplified | boolean | True for a team-managed project. Left out when false. |
projects[].project.projectCategory | object | Category of the project, with id, name, description and self. Left out when the project has no category. |
projects[].project.insight | object | Activity summary, with totalIssueCount and lastIssueUpdateTime. Left out when Jira returns none. |
projects[].project.lead | object | The project lead, a user object (see user below). Left out when Jira returns none. |
projects[].project.components | array of objects | Project components, each with id, name, description, self, assignee, assigneeType, project and projectId. Left out when none. |
projects[].project.issueTypes | array of objects | Issue types Jira lists on the project, each with id and name. Left out when none. |
projects[].workflow_schemes | array of objects | Workflow schemes associated with the project. Left out when none. |
projects[].workflow_schemes[].id | integer | Scheme ID. |
projects[].workflow_schemes[].name | string | Scheme name. |
projects[].workflow_schemes[].description | string | Scheme description. Left out when empty. |
projects[].workflow_schemes[].defaultWorkflow | string | Name of the default workflow. Left out when empty. |
projects[].workflow_schemes[].issueTypeMappings | object (string to string) | Issue type to workflow name. Left out when empty. |
projects[].workflow_schemes[].draft | boolean | True for a draft scheme. Left out when false. |
projects[].workflow_schemes[].self | string | API URL of the scheme. Left out when empty. |
projects[].workflows | array of objects | Workflows the project's issues use, found through its workflow schemes, or by name or scope when it has no scheme. Left out when none. |
projects[].workflows[].id | string | Workflow ID. |
projects[].workflows[].name | string | Workflow name. |
projects[].workflows[].description | string | Workflow description. Left out when empty. |
projects[].workflows[].scope | object | Where the workflow applies: type (GLOBAL or PROJECT) and, for a project-scoped workflow, project. |
projects[].workflows[].version | object | Workflow version, with id and versionNumber. |
projects[].workflows[].isEditable | boolean | Whether the workflow can be edited. Left out when false. |
projects[].workflows[].published | boolean | Whether the workflow is published. Left out when false. |
projects[].workflows[].created | string | Creation time as Jira reports it. Left out when empty. |
projects[].workflows[].modified | string | Last modification time as Jira reports it. Left out when empty. |
projects[].workflows[].statuses | array of objects | Statuses in the workflow. Left out when none. Each has the fields below. |
projects[].workflows[].statuses[].id | string | Status ID. |
projects[].workflows[].statuses[].name | string | Status name. |
projects[].workflows[].statuses[].statusReference | string | Reference that ties the status to the global status. |
projects[].workflows[].statuses[].statusCategory | string | Status category, for example TODO, IN_PROGRESS or DONE. Left out when empty. |
projects[].workflows[].statuses[].approvalConfiguration | object | Approval rule on the status: active, conditionType (number, percent or numberPerPrincipal), conditionValue, fieldId, transitionApproved, transitionRejected, and optionally exclude and prePopulatedFieldId. Left out when the status needs no approval. |
projects[].workflows[].transitions | array of objects | Transitions in the workflow. Left out when none. Each has the fields below. |
projects[].workflows[].transitions[].id | string | Transition ID. |
projects[].workflows[].transitions[].name | string | Transition name. |
projects[].workflows[].transitions[].toStatusReference | string | Status the transition leads to. Left out when empty. |
projects[].workflows[].transitions[].fromStatus | array of strings | Status references the transition starts from. Left out when none. |
projects[].workflows[].transitions[].type | string | Transition type, for example DIRECTED. Left out when empty. |
projects[].workflows[].transitions[].isConditional | boolean | True when the transition has conditions. Left out when false. |
projects[].issues | array of objects | Open change request issues of the project. Left out when there are none. |
projects[].issues[].key | string | Issue key, for example PAY-142. |
projects[].issues[].fields | object | The issue's fields as Jira returns them, keyed by field ID, such as summary, status, issuetype, project, assignee and any custom field. |
projects[].issues[].fields_with_metadata | array of objects | The same fields with their definition: id, name, type, custom and value. Left out when empty. |
projects[].issues[].changelog | object or null | Change history: histories, startAt, maxResults and total. Each history has author, created (RFC 3339) and items with field, fromString and toString. Null when no changelog was fetched. |
projects[].issues[].approvals | array of objects | Service Management approvals on the issue. Left out when none. |
projects[].issues[].approvals[].id | string | Approval ID. |
projects[].issues[].approvals[].name | string | Approval name. Left out when empty. |
projects[].issues[].approvals[].finalDecision | string | approved, declined or pending. Left out when empty. |
projects[].issues[].approvals[].canAnswerApproval | boolean | Whether the calling account can answer the approval. Left out when false. |
projects[].issues[].approvals[].approvers | array of objects | Each approver is an object with approver (a user object) and approverDecision, left out when empty. |
projects[].issues[].approvals[].createdDate | object | When the approval was created, with epochMillis, friendly, iso8601 and jira. Each is left out when empty. |
projects[].issues[].approvals[].completedDate | object | When the approval was completed, with the same fields as createdDate. |
projects[].issues[].slas | array of objects | Service Management SLAs on the issue. Left out when none. |
projects[].issues[].slas[].id | string | SLA ID. |
projects[].issues[].slas[].name | string | SLA name. |
projects[].issues[].slas[].state | string | MET, BREACHED or IN_PROGRESS. |
projects[].issues[].slas[].completedCycles | array of objects | Finished SLA cycles. Left out when none. |
projects[].issues[].slas[].ongoingCycle | object | The running cycle. Left out when there is none. Cycles have breached, withinCalendar and the times startTime, stopTime, breachTime, elapsedTime, remainingTime and goalDuration, each with friendly, millis, jira and iso8601. |
projects[].issues[].dev_info | object | Linked development data. Left out when none was found. |
projects[].issues[].dev_info.pull_requests | array of objects | Pull requests linked to the issue, each with id, status and url. |
projects[].issues[].deployments | array of objects | Deployments linked to the issue, each with id, environment, status and timestamp (RFC 3339). Left out when none. |
projects[].issue_types | array of objects | Issue types used by the project's issues, each with id and name. Left out when none. |
projects[].fields | array of objects | Field definitions matching the fields of the project's issues, each with id, name and schema. Left out when none. |
projects[].statuses | array of objects | Statuses the project's issues are in, each with id, name, scope, and optionally description, statusCategory, statusReference, iconUrl and self. Left out when none. |
global_permissions | array of objects | Global permissions of the account the plugin uses, each with key, name, description and type. Left out when none. |
audit_records | array of objects | Jira audit log records. Left out when none. |
audit_records[].id | integer | Record ID. |
audit_records[].summary | string | What happened. |
audit_records[].created | string (RFC 3339 time) | When it happened. Null when Jira gives no time. |
audit_records[].category | string | Audit category. |
audit_records[].authorAccountId | string | Account that made the change. Left out when empty. |
audit_records[].authorKey | string | Legacy user key of the author. Left out when empty. |
audit_records[].description | string | Longer description. Left out when empty. |
audit_records[].eventSource | string | Where the change came from. Left out when empty. |
audit_records[].remoteAddress | string | IP address of the author. Left out when empty. |
audit_records[].objectItem | object | The object changed, with id, name, typeName, parentId and parentName. Left out when none. |
audit_records[].associatedItems | array of objects | Related objects, with the same fields as objectItem. Left out when none. |
audit_records[].changedValues | array of objects | Changes made, each with fieldName, changedFrom and changedTo. Left out when none. |
An example input:
{
"projects": [
{
"project": {
"id": "10042",
"key": "PAY",
"name": "Payments Platform",
"self": "https://example.atlassian.net/rest/api/3/project/10042",
"style": "classic",
"lead": {
"accountId": "5b10ac8d82e05b22cc7d4ef5",
"displayName": "Alex Example",
"active": true
}
},
"workflow_schemes": [
{
"id": 10100,
"name": "Change management scheme",
"defaultWorkflow": "Change workflow",
"issueTypeMappings": {
"Change Request": "Change workflow"
}
}
],
"workflows": [
{
"id": "7f3a9c1e-2b44-4d6a-9a10-5e8c3d2b1f00",
"name": "Change workflow",
"scope": {
"type": "GLOBAL"
},
"startPointLayout": {
"x": 0,
"y": 0
},
"version": {
"id": "3c9e5f0a-1d2b-4c3d-8e4f-6a7b8c9d0e1f",
"versionNumber": 2
},
"statuses": [
{
"id": "10001",
"name": "In Review",
"scope": {
"type": "GLOBAL"
},
"statusCategory": "IN_PROGRESS",
"statusReference": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f60718",
"layout": {
"x": 120,
"y": 40
},
"approvalConfiguration": {
"active": "true",
"conditionType": "number",
"conditionValue": "1",
"fieldId": "customfield_10200",
"transitionApproved": "31",
"transitionRejected": "41"
}
}
],
"transitions": [
{
"id": "31",
"name": "Approve",
"toStatusReference": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"fromStatus": [
"4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f60718"
],
"type": "DIRECTED"
}
]
}
],
"issues": [
{
"key": "PAY-142",
"fields": {
"summary": "Rotate payment gateway credentials",
"issuetype": {
"id": "10300",
"name": "Change Request"
},
"project": {
"id": "10042",
"key": "PAY"
},
"status": {
"name": "In Review",
"statusCategory": {
"name": "In Progress"
}
}
},
"changelog": {
"histories": [
{
"author": {
"accountId": "5b10ac8d82e05b22cc7d4ef5",
"displayName": "Alex Example"
},
"created": "2026-03-02T09:15:30+01:00",
"items": [
{
"field": "status",
"fromString": "To Do",
"toString": "In Review"
}
]
}
],
"startAt": 0,
"maxResults": 100,
"total": 1
},
"approvals": [
{
"id": "501",
"name": "Change approval",
"finalDecision": "pending",
"approvers": [
{
"approver": {
"accountId": "5b10ac8d82e05b22cc7d4ef6",
"displayName": "Sam Sample"
},
"approverDecision": "pending"
}
],
"createdDate": {
"epochMillis": 1772442930000,
"iso8601": "2026-03-02T09:15:30+0100"
}
}
],
"slas": [
{
"id": "7",
"name": "Time to approval",
"state": "IN_PROGRESS"
}
],
"dev_info": {
"pull_requests": [
{
"id": "88",
"status": "MERGED",
"url": "https://git.example.com/acme/payments/pull/88"
}
]
},
"deployments": [
{
"id": "d-2001",
"environment": "production",
"status": "successful",
"timestamp": "2026-03-03T14:00:00Z"
}
]
}
],
"issue_types": [
{
"id": "10300",
"name": "Change Request"
}
],
"fields": [
{
"id": "summary",
"name": "Summary",
"schema": {
"type": "string",
"system": "summary"
}
}
],
"statuses": [
{
"id": "10001",
"name": "In Review",
"scope": {
"type": "GLOBAL"
},
"statusCategory": "IN_PROGRESS"
}
]
}
],
"global_permissions": [
{
"key": "ADMINISTER",
"name": "Administer Jira",
"description": "Create and administer projects, issue types, fields, workflows, and schemes for projects and issues.",
"type": "GLOBAL"
}
],
"audit_records": [
{
"id": 90210,
"summary": "Workflow updated",
"created": "2026-03-01T16:11:45Z",
"category": "workflows",
"authorAccountId": "5b10ac8d82e05b22cc7d4ef5",
"eventSource": "Jira Cloud",
"objectItem": {
"id": "7f3a9c1e-2b44-4d6a-9a10-5e8c3d2b1f00",
"name": "Change workflow",
"typeName": "WORKFLOW"
}
}
]
}
Subject templates
The subject templates this plugin registers. Each example is built from sample data.
jira-project
A Jira project. Title: Jira Project: {{ .project_key }}. The evidence also carries provider (jira), project_name and jira_url labels, which are not part of the identity.
| Identity key | Description |
|---|---|
project_key | The unique key of the Jira project, for example PAY. |
Example:
{
"name": "jira-project",
"type": "component",
"title": "Jira Project: PAY",
"description": "Jira project Payments Platform (PAY)",
"purpose": "Represents a Jira project being monitored for compliance",
"identityLabels": {
"project_key": "PAY"
}
}
Policies
The policy bundles that work with this plugin, at their newest releases. The controls are the ones the bundle's policies list in their metadata.
| Bundle | Latest version | Controls covered | Compatible plugin lines |
|---|---|---|---|
plugin-jira-custom-policies | v0.2.1 | none listed | latest |
plugin-jira-policies | v0.2.1 | none listed | latest |