Repository navigation
v6.3.0
Jira.js 6.3.0 expands the library beyond Jira Cloud while tightening the transport and correcting API shapes found against real Atlassian responses. The release adds clients for Jira Data Center, Jira Service Management Data Center, Assets on Cloud and Data Center, Atlassian Administration, user management, SCIM provisioning, and Teams. It also restores the API reference inside the VitePress site, fixing #459.
The generated surfaces were refreshed from Atlassian's current documents, but the release keeps the public contracts that valid 6.2 code depends on, with two deliberate exceptions on the Cloud surface: the Issue model now types the system fields that 6.2 left as any, and Field.schema is optional because Jira omits it for some system fields (see Types and deprecations). Apart from those, valid code that compiled against 6.2 remains source-compatible. Renamed methods and models retain deprecated aliases until 7.0. Type errors introduced by this release identify request shapes Jira already rejected.
Before upgrading
- Node.js 22 and ESM remain the runtime baseline. TypeScript 5.7 is the documented and tested compiler floor. TypeScript is not installed or enforced as a peer dependency;
check:consumersinstalls 5.7 separately and verifies the packed declarations withskipLibCheckdisabled. - Requests are more precise. Misspelt nested keys, response-only issue fields used in writes, missing parameters that Jira documents and enforces as required, string values passed where Jira expects booleans, and object bodies passed to endpoints that expect a string or array now fail during compilation. These are not newly unsupported requests: Jira already rejected them.
Field.schemacan be absent. The Cloud field search returns system fields without a schema, which 6.2 reported as a schema mismatch; the property is now optional, sofield.schema.typeneeds a guard understrict.- The
fieldsparameter of the Jira Software issue listings (getIssuesForBoard,getIssuesForBacklog,getIssuesForSprint,getIssuesForEpic,getIssuesWithoutEpic,getBoardIssuesForEpic,getBoardIssuesForSprint,getIssuesWithoutEpicForBoard, andgetIssue) is a list of field names. 6.2 typed it as a list of objects, which could not express a field name at all. - Authentication refusal is now observable. Jira can answer an authenticated request as an anonymous user with status 200 while setting
X-Seraph-LoginReason. When credentials were supplied and that header reportsAUTHENTICATED_FAILEDorAUTHENTICATION_DENIED, the client throwsAuthErrorinstead of returning anonymous or empty data. Code that treated a revoked token as a legitimate empty result must handle the error. Fixes #418. - Response validation remains tolerant of undocumented fields. Compatibility-only optional response types do not weaken runtime checks: when Atlassian's contract requires a field, the schema still reports its absence.
New clients and entry points
createAdminClient, createUserManagementClient, and createUserProvisioningClient cover organization administration, managed accounts, and SCIM provisioning. They default to https://api.atlassian.com and accept bearer credentials intended for those organization APIs. Site API tokens and OAuth 2.0 (3LO) are not interchangeable with organization credentials. Closes #317, #316 and #315.
The administration client separates product access from organization-wide roles: grantUserAccess and revokeUserAccess manage access to a product, while assignOrganizationRole and revokeOrganizationRole manage roles such as organization administrator. Its read-only live coverage also corrected pagination links, nullable profile fields, absent optional policy fields, and workspace relationships that arrive as arrays of policies, entitlements, or features under the name of each. The user-management surface intentionally models the fields Atlassian lets callers change instead of accepting a complete read model as an update body.
import { createAdminClient } from 'jira.js';
const admin = createAdminClient({
auth: { type: 'bearer', token: organizationApiKey },
});
const users = await admin.users.getDirectoryUsers({ orgId, directoryId, limit: 50 });createTeamsClient exposes teams, members, and external-directory links. Most operations take orgId; queryTeams and createTeam also require siteId because the live API rejects calls without it on site-scoped organizations. getTenantContext resolves the site's cloudId, orgId, and host name through the Atlassian gateway. Closes #364.
import { createClient, getTenantContext } from 'jira.js/core';
import { createTeamsClient } from 'jira.js';
const { cloudId: siteId, orgId } = await getTenantContext(createClient({ host, auth }));
const teams = createTeamsClient({ host, auth });
const page = await teams.teams.queryTeams({ orgId, siteId });createAssetsClient adds the Assets Cloud API. It uses an Assets workspaceId, not the Jira site URL; obtain that identifier from Service Management. The surface includes objects, schemas, object types and attributes, AQL, icons, status and reference types, and import sources. This closes #266.
Assets configuration types are generated from the contract rather than flattened into open objects. In particular, an attribute's DefaultType is a union of the documented id/name pairs, so an impossible combination is rejected while every published pair remains suggested by the editor. Import responses preserve undocumented invalidity details as arbitrary JSON instead of pretending those values have a fixed object shape.
import { createAssetsClient, createServiceDeskClient } from 'jira.js';
const serviceDesk = createServiceDeskClient({ host, auth });
const [workspace] = (await serviceDesk.assets.getAssetsWorkspaces()).values ?? [];
const assets = createAssetsClient({ workspaceId: workspace.workspaceId, auth });
await assets.objects.loadObject({ id: '42' });createServerClient adds the self-hosted Jira platform and Jira Software APIs from Atlassian's Jira Data Center 11.3 specification. Boards and sprints live on this client rather than a separate Agile factory. The automated rig currently verifies the surface against Jira Software Data Center 10.3; operations introduced in newer releases carry their availability in generated documentation.
import { createServerClient } from 'jira.js';
const jira = createServerClient({
host: 'https://jira.example.com',
auth: { type: 'bearer', token: personalAccessToken },
});
await jira.issues.getIssue({ issueIdOrKey: 'PROJ-1' });createServiceDeskServerClient and createAssetsServerClient add the corresponding Jira Service Management Data Center surfaces. They cover requests, comments, SLAs, queues, request types, organizations, approvals, customer transitions, Assets objects and schemas, attachments, comments, archiving, QR codes, and index control.
Data Center is a separate generated surface, not the Cloud client pointed at another host. It uses /rest/api/2, carries Data Center user identifiers and wiki-markup conventions, and includes Jira Software operations in the same document. The client accepts the authentication strategies supported by the self-hosted transport, including bearer personal access tokens. Personal access tokens are available in Jira Core and Jira Software 8.14 or later; customized installations may still require the authentication method selected by their administrators.
Self-hosted webhooks are included under server.webhooks. Atlassian does not publish them in the OpenAPI document, so their request paths were recovered from the WADL served by a running instance and their bodies from real calls. Create, list, update, delete, and the associated reads are covered by the Data Center live rig rather than being inferred from Cloud equivalents.
jira.js/webhooks now exports webhook headers and a discriminated WebhookPayload union. The payload types describe what Jira posts to your server; they deliberately do not parse or strip site-specific fields. Closes #294.
Issue-event payloads are based on Atlassian's complete example and a captured delivery. Other event families keep their entity optional because Atlassian documents the event names but not one universal body. Header names are lower-case as they arrive through Node HTTP servers, and retry metadata remains a string like every other HTTP header.
import type { WebhookPayload } from 'jira.js/webhooks';
function handle(payload: WebhookPayload) {
if (payload.webhookEvent === 'jira:issue_created') {
console.log(payload.issue.key);
}
}verifyWebhookSignature validates the x-hub-signature HMAC over the exact request bytes and uses a constant-time comparison. A parsed and re-serialized JSON object is not the same byte sequence.
import { verifyWebhookSignature } from 'jira.js/webhooks';
const trusted = await verifyWebhookSignature({
body: rawBody,
secret: process.env.JIRA_WEBHOOK_SECRET!,
signature: request.headers['x-hub-signature'],
});Transport and shared API
Every generated call accepts an optional RequestOptions argument with an AbortSignal. The signal reaches fetch and also interrupts retry backoff. Abort and timeout reasons are rethrown unchanged instead of being wrapped in NetworkError; aborting one request does not cancel an OAuth refresh shared by other requests. Fixes #406.
await jira.issues.getIssue(
{ issueIdOrKey: 'PROJ-1' },
{ signal: AbortSignal.timeout(5_000) },
);ClientConfig.fetch replaces the global transport for the complete authentication and request flow, including OAuth token refresh and cloud-id resolution. This restores the logging, proxying, tracing, and fixture-recording seam that was lost with the axios removal. A wrapper that records bodies can see OAuth secrets, so redact them before logging. Fixes #404.
import { fetch as undiciFetch, ProxyAgent } from 'undici';
const dispatcher = new ProxyAgent(process.env.HTTPS_PROXY!);
const jira = createCloudClient({
host,
auth,
fetch: (url, init) => undiciFetch(url, { ...init, dispatcher }),
});Request parameter types are published from jira.js/<surface>/parameters, avoiding collisions with model names while remaining tree-shakeable. SendRequestOptions.headers accepts string | undefined; undefined entries are omitted and no longer erase a client-wide header. jira.js/core additionally exports the individual authentication schemas, CommonClientConfig, ParsedClientConfig, ErrorKind, and getTenantContext.
The custom transport receives (url: string, init: RequestInit) rather than typeof globalThis.fetch. That keeps standards-compatible wrappers straightforward and lets runtimes such as undici add their own initialization fields without forcing a cast at every call site. OAuth refresh remains single-flight: concurrent requests share one refresh attempt, while cancellation applies only to the request whose signal was aborted.
Fixes
- The VitePress deployment owns
/api/again. API navigation, search, direct links, and reloads stay in one documentation application instead of producing a client-side 404. Fixes #459. - Administration pagination now serializes
sortByfor bothadmin.groups.getGroupsandadmin.users.getDirectoryUsers. The live suite verifies ascending, descending, multi-field ordering, and the cursor echoed by Atlassian. - Data Center response patches now match the running products: collection endpoints return arrays, Agile reads return pages or search results, Service Management pages use
Page<T>, and operations whose specifications omitted a response schema expose their real model or binary body. - The generator now counts operations before and after transformation. A collision such as the differently spelled
{permission-id}and{permissionId}paths can no longer silently replace one operation with another; generation fails until the path is corrected. - Entity-property endpoints accept and return arbitrary JSON. Missing request bodies were restored for issue, project, board, sprint, comment, issue-type, user, and dashboard-item properties.
- Multipart uploads use
FormData; plain-text, form-encoded, and zip endpoints send their documented media types. Email-template downloads return aBufferinstead of discarding the archive. - Assets Data Center corrects list envelopes, archived-object shapes, archive-by-key bodies, attribute value types, upload timestamps, and the differing read/write forms of object schemas.
- Data Center path and body corrections restore operations previously overwritten or impossible to call, including
getSharePermission, application-property writes, webhooks, project lists, fields, statuses, versions, screens, subtasks, and remote issue links. - Cloud, Agile, and Service Management models were refreshed from Atlassian's current documents. Nullable issue fields parse as null rather than coercing dates to the epoch; Unicode string limits count code points; malformed HTML descriptions are normalized to Markdown before API documentation is generated.
- Data Center takes its arguments with the types Cloud takes them. Filter, scheme, and share-permission ids are numbers; board and sprint ids on the property operations are strings, as they are on Cloud;
fields,expand,properties, and a sprint'sstatetake a comma-separated string or a list; paging parameters are numbers and flags,deleteSubtasksamong them, are booleans rather than the strings the specification declares. KnownorderByvalues remain editor suggestions without closing the type to vendor extensions. - Four Data Center user searches (
findUsers,findAssignableUsers,findBulkAssignableUsers,findUsersWithBrowsePermission) return theUser[]Jira sends instead of a singleUser. - Organization administration parses what a populated organization returns:
nullfordeactivatedOnon active directory users, for a policy'slinksandupdatedAt, for the position counters of the policy and audit-event pages, and for thelinksof event actions; an event actor'slinksmay omitself. A workspace'srelationshipsare typed by name:policy,entitlement,featureandrelatesFromEntitlementeach hold an array of their own resource, with the attributes Atlassian documents and the ones it was measured to send; the release candidate read every name as an array of the three documented resources without telling them apart. - Fields Atlassian sends without documenting them are typed with the shape that came back on the Jira Software epic (
issueColor), Assets statuses and object schemas (cdmDataamong them), policy rules and theirnotificationentries, and audit-event actors. issueCustomFieldContexts.setContextDefaultValuesis available, andserviceDesk.request.getAttachmentsForRequestno longer requiresstartandlimit.- Non-object request bodies are no longer forced through
Record<string, any>.issueWatchers.addWatcherandmyself.setPreferencesend a JSON string; app migration sends anEntityPropertyDetails[]; Service Management temporary attachments use multipart files. serviceDesk.request.validateCustomerRequestis generated and available.getInsightWorkspacesremains callable but is marked deprecated in favor ofgetAssetsWorkspaces.
Types and deprecations
Issue.fields now documents the system fields and keeps arbitrary response keys available. Direct issue.fields?.customfield_10016 access remains source-compatible and permissive; request inputs accept only documented writable fields plus customfield_*, so misspellings and response-only fields are rejected. Recursive schemas retain concrete Zod object types, so IssueSchema.extend(...) and IssueSchema.shape continue to work.
The documented system fields are a source-breaking change for code that read them as any in 6.2. issue.fields?.summary is string | undefined, values of renderedFields and properties are unknown and must be narrowed, and created, updated, resolutiondate, statuscategorychangedate and lastViewed are parsed into Date objects instead of ISO strings. Code that calls string methods on those dates must format them first.
DashboardUser keeps its 6.2 shape and remains the return type of myself, users and userSearch operations, but it is deprecated in favor of User and removed in 7.0. Jira returns null for the emailAddress and locale of users hidden by privacy settings; DashboardUser turns that null into undefined, so the value matches its 6.2 type. User keeps the null and types both fields as nullable, and a returned DashboardUser can be assigned to it. Lower-case bulk-move model names and other renamed public models likewise remain as deprecated aliases.
startAt and maxResults of issueNotificationSchemes.getNotificationSchemes, issueNotificationSchemes.getNotificationSchemeToProjectMappings, and issuePriorities.searchPriorities are numbers, which is what Jira reads them as. The strings 6.2 required are still accepted, so maxResults: '50' keeps compiling, and are removed in 7.0.
The 6.2 return signatures are preserved for timeTracking.getSelectedTimeTrackingImplementation, jqlFunctionsApps.updatePrecomputations, workflowSchemeDrafts.publishDraftWorkflowScheme, agile.board.moveIssuesToBoard, and workflowSchemes.updateSchemes. Runtime handling still accepts documented empty 204 responses; compatibility casts are applied only at the public boundary.
Fields that Atlassian now marks required in responses can remain optional in the public TypeScript output where 6.2 allowed omission. The Zod schemas still require them on the wire, so compatibility does not hide contract drift. Conversely, request fields remain required where Jira rejects their absence.
This split covers FieldMetadata.schema, security-level holders, workflow-scheme associations, dashboard gadget positions, plan scheduling, issue-link types, and Jira expression complexity counters. A user can still assign a partial response-shaped fixture where 6.2 allowed it, but parsing a real response with the required key missing produces a schema mismatch. CreatePermissionRequest.holder and CreatePlanRequest.scheduling stay optional because no public operation sends those models and making them required would remove a previously valid construction without preventing a failing Jira call.
Nested request models are exact on input and loose on output. Jira can add a response field without breaking a consumer, while sharePermissions: [{ type: 'global', typo: 1 }] and fields: { summaryy: 'x' } fail before the request is sent. Issue writes expose IssueFieldsInput, excluding status, creator, timestamps, attachments, comments, progress, votes, watches, and the other fields Jira only reports.
JSON slots such as issue entity properties, task results, Service Management form answers, and Assets invalidity details accept arbitrary JSON values. Read values are permissive and should be narrowed before use.
Verification and known limitations
The generator owns these compatibility rules. Regenerating from the same source keeps the aliases, public return types, recursive schema behavior, request/output split, and runtime response checks; the release does not rely on hand-edited generated files. A compile-only 6.2 fixture pins the old usage patterns, and consumer checks install the packed tarball into clean bundler and nodenext projects, both with the current compiler and at the TypeScript 5.7 floor.
The same generator tests pin the markers that distinguish public compatibility from wire validation. That matters for future Atlassian refreshes: a normal regeneration must reproduce the compatibility declarations and will fail tests if a schema, endpoint, or renamed model no longer receives the required transform.
Unit, type, lint, build, browser-safety, documentation, and packed-consumer checks run before publication. Cloud live tests and schema audit cover the hosted APIs. Data Center and Service Management use separate Docker rigs and coverage ledgers; missing timebomb-licence secrets now fail their workflows with an explicit diagnostic instead of producing a misleading result.
Some product limitations remain external to the library. User management operations require claimed-domain accounts and currently reject the scoped key available to the development organization. SCIM provisioning requires Atlassian Guard and is not live-verified. Assets Cloud requires an eligible Jira Service Management plan. Without a Jira Service Management Data Center licence, the Service Desk surface returns 403 HTML for all tested operations except getInfo; the workflow therefore requires its own licence secret.