Skip to main content

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:

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:

  1. Create a dedicated Atlassian account (e.g., compliance-bot@yourcompany.com).
  2. Invite this account to your Jira instance.
  3. Follow Atlassian's guide on Service Accounts.
Option B: API Token (Fallback)​
  1. Log in to Jira as the Service Account.
  2. Go to Account Settings > Security > API Tokens.
  3. 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 Projects
    • View Development Tools (for Software API dev links)
    • Administer Projects (optional, for detailed workflow/scheme inspection)
  • OAuth Scopes (Cloud):
    • read:jira-work
    • read:jira-user
    • read:servicedesk-request
    • manage:jira-configuration (for workflows and schemes)

Configuration​

The plugin is configured via the PluginConfig structure:

ParameterDescription
base_urlThe URL of your Jira instance (e.g., https://your-domain.atlassian.net)
auth_typeoauth2 or token
client_idOAuth2 Client ID (for oauth2 auth)
client_secretOAuth2 Client Secret (for oauth2 auth)
api_tokenAPI Token (for token auth)
user_emailService Account email (for token auth)
project_keysComma-separated list of Project Keys to monitor
policy_labelsJSON 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.

FieldTypeDescription
projectsarray of objectsOne entry, the project being evaluated. The fields below are inside it.
projects[].projectobjectThe Jira project.
projects[].project.idstringNumeric ID of the project, as a string.
projects[].project.keystringProject key, for example PAY.
projects[].project.namestringProject display name.
projects[].project.selfstringAPI URL of the project. Left out when empty.
projects[].project.descriptionstringProject description. Left out when empty.
projects[].project.stylestringclassic or next-gen. Left out when empty.
projects[].project.simplifiedbooleanTrue for a team-managed project. Left out when false.
projects[].project.projectCategoryobjectCategory of the project, with id, name, description and self. Left out when the project has no category.
projects[].project.insightobjectActivity summary, with totalIssueCount and lastIssueUpdateTime. Left out when Jira returns none.
projects[].project.leadobjectThe project lead, a user object (see user below). Left out when Jira returns none.
projects[].project.componentsarray of objectsProject components, each with id, name, description, self, assignee, assigneeType, project and projectId. Left out when none.
projects[].project.issueTypesarray of objectsIssue types Jira lists on the project, each with id and name. Left out when none.
projects[].workflow_schemesarray of objectsWorkflow schemes associated with the project. Left out when none.
projects[].workflow_schemes[].idintegerScheme ID.
projects[].workflow_schemes[].namestringScheme name.
projects[].workflow_schemes[].descriptionstringScheme description. Left out when empty.
projects[].workflow_schemes[].defaultWorkflowstringName of the default workflow. Left out when empty.
projects[].workflow_schemes[].issueTypeMappingsobject (string to string)Issue type to workflow name. Left out when empty.
projects[].workflow_schemes[].draftbooleanTrue for a draft scheme. Left out when false.
projects[].workflow_schemes[].selfstringAPI URL of the scheme. Left out when empty.
projects[].workflowsarray of objectsWorkflows 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[].idstringWorkflow ID.
projects[].workflows[].namestringWorkflow name.
projects[].workflows[].descriptionstringWorkflow description. Left out when empty.
projects[].workflows[].scopeobjectWhere the workflow applies: type (GLOBAL or PROJECT) and, for a project-scoped workflow, project.
projects[].workflows[].versionobjectWorkflow version, with id and versionNumber.
projects[].workflows[].isEditablebooleanWhether the workflow can be edited. Left out when false.
projects[].workflows[].publishedbooleanWhether the workflow is published. Left out when false.
projects[].workflows[].createdstringCreation time as Jira reports it. Left out when empty.
projects[].workflows[].modifiedstringLast modification time as Jira reports it. Left out when empty.
projects[].workflows[].statusesarray of objectsStatuses in the workflow. Left out when none. Each has the fields below.
projects[].workflows[].statuses[].idstringStatus ID.
projects[].workflows[].statuses[].namestringStatus name.
projects[].workflows[].statuses[].statusReferencestringReference that ties the status to the global status.
projects[].workflows[].statuses[].statusCategorystringStatus category, for example TODO, IN_PROGRESS or DONE. Left out when empty.
projects[].workflows[].statuses[].approvalConfigurationobjectApproval 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[].transitionsarray of objectsTransitions in the workflow. Left out when none. Each has the fields below.
projects[].workflows[].transitions[].idstringTransition ID.
projects[].workflows[].transitions[].namestringTransition name.
projects[].workflows[].transitions[].toStatusReferencestringStatus the transition leads to. Left out when empty.
projects[].workflows[].transitions[].fromStatusarray of stringsStatus references the transition starts from. Left out when none.
projects[].workflows[].transitions[].typestringTransition type, for example DIRECTED. Left out when empty.
projects[].workflows[].transitions[].isConditionalbooleanTrue when the transition has conditions. Left out when false.
projects[].issuesarray of objectsOpen change request issues of the project. Left out when there are none.
projects[].issues[].keystringIssue key, for example PAY-142.
projects[].issues[].fieldsobjectThe 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_metadataarray of objectsThe same fields with their definition: id, name, type, custom and value. Left out when empty.
projects[].issues[].changelogobject or nullChange 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[].approvalsarray of objectsService Management approvals on the issue. Left out when none.
projects[].issues[].approvals[].idstringApproval ID.
projects[].issues[].approvals[].namestringApproval name. Left out when empty.
projects[].issues[].approvals[].finalDecisionstringapproved, declined or pending. Left out when empty.
projects[].issues[].approvals[].canAnswerApprovalbooleanWhether the calling account can answer the approval. Left out when false.
projects[].issues[].approvals[].approversarray of objectsEach approver is an object with approver (a user object) and approverDecision, left out when empty.
projects[].issues[].approvals[].createdDateobjectWhen the approval was created, with epochMillis, friendly, iso8601 and jira. Each is left out when empty.
projects[].issues[].approvals[].completedDateobjectWhen the approval was completed, with the same fields as createdDate.
projects[].issues[].slasarray of objectsService Management SLAs on the issue. Left out when none.
projects[].issues[].slas[].idstringSLA ID.
projects[].issues[].slas[].namestringSLA name.
projects[].issues[].slas[].statestringMET, BREACHED or IN_PROGRESS.
projects[].issues[].slas[].completedCyclesarray of objectsFinished SLA cycles. Left out when none.
projects[].issues[].slas[].ongoingCycleobjectThe 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_infoobjectLinked development data. Left out when none was found.
projects[].issues[].dev_info.pull_requestsarray of objectsPull requests linked to the issue, each with id, status and url.
projects[].issues[].deploymentsarray of objectsDeployments linked to the issue, each with id, environment, status and timestamp (RFC 3339). Left out when none.
projects[].issue_typesarray of objectsIssue types used by the project's issues, each with id and name. Left out when none.
projects[].fieldsarray of objectsField definitions matching the fields of the project's issues, each with id, name and schema. Left out when none.
projects[].statusesarray of objectsStatuses the project's issues are in, each with id, name, scope, and optionally description, statusCategory, statusReference, iconUrl and self. Left out when none.
global_permissionsarray of objectsGlobal permissions of the account the plugin uses, each with key, name, description and type. Left out when none.
audit_recordsarray of objectsJira audit log records. Left out when none.
audit_records[].idintegerRecord ID.
audit_records[].summarystringWhat happened.
audit_records[].createdstring (RFC 3339 time)When it happened. Null when Jira gives no time.
audit_records[].categorystringAudit category.
audit_records[].authorAccountIdstringAccount that made the change. Left out when empty.
audit_records[].authorKeystringLegacy user key of the author. Left out when empty.
audit_records[].descriptionstringLonger description. Left out when empty.
audit_records[].eventSourcestringWhere the change came from. Left out when empty.
audit_records[].remoteAddressstringIP address of the author. Left out when empty.
audit_records[].objectItemobjectThe object changed, with id, name, typeName, parentId and parentName. Left out when none.
audit_records[].associatedItemsarray of objectsRelated objects, with the same fields as objectItem. Left out when none.
audit_records[].changedValuesarray of objectsChanges 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 keyDescription
project_keyThe 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.

BundleLatest versionControls coveredCompatible plugin lines
plugin-jira-custom-policiesv0.2.1none listedlatest
plugin-jira-policiesv0.2.1none listedlatest

References​