Repository navigation
v6.2.0
Avatars moved bytes in both directions and the specification described both as JSON, so neither direction worked. Reading an image threw before the response reached the caller; uploading one had no way to send an image at all. Both are fixed here, along with two column endpoints broken by the same reading of the same specification.
Bug Fixes
-
getAvatarImageByID,getAvatarImageByTypeandgetAvatarImageByOwnerreturn the image. All three were generated withStreamingResponseBodySchema— the specification'sStreamingResponseBody, an object with no properties — so a response arriving asimage/pngorimage/svg+xmlwas reported asSchemaMismatchError: Expected a JSON response to validate against the schema. There was no input for which they could succeed. They now return aBlob. Fixes #434.A
Blobrather than the bytes alone, because the content type cannot be worked out from the request: the same avatar URL answers with SVG for a system avatar and PNG for an uploaded one, andformatis optional.image.typeis the content type,await image.arrayBuffer()the bytes, andnew Response(image)passes it straight to a browser. In v5 this wasAvatarWithDetails—{ avatar, contentType }; the two fields are now one value.Attachment downloads are unchanged.
getAttachmentContentandgetAttachmentThumbnailstill return the bytes, because an attachment already carries itsmimeTypeandfilenamein its metadata. -
storeAvatar,createProjectAvatarandcreateIssueTypeAvataraccept an image. Their request body was generated asRecord<string, any>— an object of arbitrary keys — because Atlassian declares it under a wildcard media type with an empty schema. It is now aBlob:await jira.avatars.storeAvatar({ type: 'project', entityId: project.id, size: 48, body: new Blob([bytes], { type: 'image/png' }), });
The
Blobcarries the content type the endpoint reads the image by;fetchtakes the header from it, so nothing is passed alongside it and nothing can contradict it. The three calls also sendX-Atlassian-Token: no-check, which Jira requires — without it the upload is refused outright, with it and no content type the image is rejected as an unsupported format. Both were verified against a live site. -
setUserColumnsandsetIssueNavigatorDefaultColumnstake the columns. Both declare aColumnRequestBodyreference under a wildcard media type and nowhere else; onlyapplication/jsonwas read, so the reference was missed and the body degraded to the same shapeless object. They now takecolumns: string[], likesetColumnson a filter already did:await jira.users.setUserColumns({ columns: ['summary', 'status'] });
Types
-
Those three methods are typed
Promise<Blob>, where they werePromise<StreamingResponseBody>. Nothing that compiled against the old type can have been working — the call threw before returning — so the compiler pointing at these lines is the first honest signal about them.StreamingResponseBodyitself is still exported; nothing else referenced it. -
BlobSchemais exported fromjira.js/core, besideBufferSchema. It marks an endpoint whose response is bytes with a content type worth keeping; the client reads such a response withresponse.blob()rather than parsing it as JSON. -
The three upload bodies are typed
Blob, where they wereRecord<string, any>. No call could have worked: the endpoints refuse a request without the XSRF header, which the old shape had no way to send. -
setUserColumnsandsetIssueNavigatorDefaultColumnstakecolumns: string[]in place ofbody. Unlike the avatar uploads, these two had a working form —{ body: { columns: [...] } }reached Jira intact — so a call written that way needs the one-line change.{ body: [...] }, the other reading the old type invited, was answered with 400. -
The agile models point at their nested shapes instead of repeating them. A board's
admins.userswas written out in full in each of the models that carried a board, and the same held for changelog histories, column statuses and issue fields across twenty-one others. They now referenceUserSchema,GroupSchema,BoardLocationSchema,RelationSchema,ChangelogSchemaand the rest, each of which was exported already and describes the identical shape, field for field and constraint for constraint. Nothing validates differently, no description was lost, and every type is structurally what it was — a nested shape simply reports itself by name in an editor now, and the generated agile sources are a thousand lines shorter. -
toggleFeaturestakes a described body. It was typedRecord<string, any>— an object of arbitrary keys — because the shape was declared inline and had no name to point at; the operation's ownboardIdcollides with the body's, so its fields cannot be spread the wayrankIssuesspreads its own. The body is nowFeatureToggleRequest:{ boardId?, enabling?, feature? }. A call already passing those three fields is unchanged. -
The agile model
GetQuickFilteris deprecated in favour ofQuickFilter. The two were the same six optional fields under two names, because the response was declared inline rather than by reference; it now resolves to the named schema, andgetQuickFilteris typedPromise<QuickFilter>. The old name is still exported, still assignable and still the same type — an alias marked@deprecated, which an editor strikes through and which goes at the next major version. Nothing has to change today. The request parameter type of that name is untouched. -
Four
orderByparameters list the fields they sort by.getPrecomputations,getPrecomputationsByID,getTrashedFieldsPaginatedandsearchWorkflowswere typedstringwhile their own documentation named the fields —functionKey,used,created,updatedfor the precomputations, and so on. Fifteen otherorderByparameters carry the list in the specification and were generated from it all along; these four carried it only in prose. They are now typed the same way, sort prefixes included:await jira.jqlFunctionsApps.getPrecomputationsByID({ precomputationIDs: [...], orderBy: '-created' });
As everywhere else, the type stays open —
'created' | '-created' | '+created' | ... | (string & {})— so an editor suggests the documented fields and any other string still compiles. -
Five more agile models are deprecated in favour of the components they were copies of.
createBoardandgetBoardanswer withBoard,getAllBoardswithPageBoard,getBoardByFilterIdwithPageBoardFilter, andgetAllQuickFilterswithPageQuickFilter. Each of those responses is declared inline in the specification, field for field the component sitting beside it, so the generator had nothing to name it after but the operation — and the component it duplicated went unused: no agile model referencedBoardat all, while six of them wrote a board out in full. The retired names are still exported as@deprecatedaliases of the new ones, assignable in both directions, and go at the next major version. Nothing has to change today.A board reports its type properly now, as a side effect worth naming.
Board.typeis'scrum' | 'kanban' | 'simple' | (string & {}); every copy of it was a plainstring, and since each of these methods returned a copy, the narrowing reached none of them.getBoard()and the boards insidegetAllBoards().valuescarry it now. -
A page of things is typed
Page<T>. Atlassian restates the pagination envelope once per item type —PageBoard,PageUser,PagedArticle, ninety-odd of them across the three APIs, identical but for what sits invalues— and each generated a model of its own. So a page of boards and a page of users were two unrelated shapes with the same seven fields, and nothing said they were the same idea. Each API now has onePage<T>, and the endpoints answering with a page are typed with it:const boards: Page<Board> = await agile.board.getAllBoards(); const comments: Page<Comment> = await jira.issueComments.getCommentsByIds({ ids: [10000, 10001] });
Three generics, not one: the envelopes genuinely differ. Cloud's carries
nextPageandself, Agile's does not, and Service Desk's is_expands/_links/isLastPage/limit/size/start— giving Agile cloud's would document two fields Jira Software never sends. Each is exported from its own entry point, all three under the namePage.Nothing is removed and nothing changes shape: the 82 retired names — 62 in cloud, 17 in Service Desk, 3 in Agile — remain exported as
@deprecatedaliases of the generic (type PageBoard = Page<Board>), assignable in both directions, going at the next major version. The schemas keep their own names, sincePageBoardSchemais the only handle on the runtime schema. Every page type was compared against the one it replaces, in both directions, before this shipped.Only exact matches folded. A page that differs by a field, a description or a format — the cursor-based pages,
PageOfChangelogs,PageOfComments,PageOfWorklogs,PagedLink— generates exactly as it did.The browser bundle drops from 481 kB to 471 kB, and the generated sources by a thousand lines: 82 copies of an envelope became three.
-
A page's own fields are no longer optional.
isLast,maxResults,startAt,totalandvalueswere all typedT | undefined, so reading a page meant reaching past a?? []and a?? 0that never fire:const page = await jira.projects.searchProjects(); for (const project of page.values) { /* was: page.values ?? [] */ }
Atlassian marks the whole envelope optional, and that is what the generator had to go on. Measured against a live site instead, those five came back on all 32 page responses across 23 platform endpoints and the agile board listings. The two that genuinely are conditional stay optional:
selfis absent from five of those endpoints, andnextPageappears only while a next page exists.Service Desk's pages are untouched — all seven of their fields stay optional. They cannot be reached from the test site, which holds no Service Management licence, and the only real captures to be found show
_expandspresent on one endpoint and absent on its neighbour. Guessing from Atlassian's examples is what this change is getting away from.Reading a page is only ever safer for the change. Constructing one is not: a
Page<T>written by hand — a fixture, a mock, a stub returned from a wrapper — now has to carry all five fields, andPageBoardSchema.parse()over such an object fails where it used to pass. -
Eleven cloud models lose the name of the serializer that made them.
Page2ComponentJsonSchemaread like an implementation detail because it was one: the2is the version of Atlassian's own Java class, andJsonandJackson1name the serializer that produced it. Neither describes anything a caller can act on —PageBean2XandPageBeanXcarry the same seven fields, and no page is declared in both forms.was is Page2ComponentJsonPageComponentPage2FieldAssociationSchemeFieldSearchResultPageFieldAssociationSchemeFieldSearchResultPage2FieldAssociationSchemeProjectSearchResultPageFieldAssociationSchemeProjectSearchResultPage2GetFieldAssociationSchemeResponsePageGetFieldAssociationSchemeResponsePage2GetProjectsWithFieldSchemesResponsePageGetProjectsWithFieldSchemesResponsePage2ProjectFieldPageProjectFieldComponentJsonComponentCustomFieldDefinitionJsonCustomFieldDefinitionLinkIssueRequestJsonLinkIssueRequestNotificationSchemeAndProjectMappingJsonNotificationSchemeAndProjectMappingJiraLabelPropertiesInputJackson1JiraLabelPropertiesEvery retired name is still exported, as a
@deprecatedalias of its replacement — both the schema and the type — assignable in both directions and going at the next major version. Nothing has to change today.Page2JqlFunctionPrecomputationhad been renamed by hand some releases ago, which is what suggested the rest were an oversight rather than a decision.Two names keep their
Jsonon purpose.ResolutionJsonwould collide with theResolutionthat describes a different shape, andTaskProgressJsonNodeis one of four models that differ only in theirresultfield — it wants the treatment the pages just had, not a new name.JsonNode,JsonTypeandJsonContextVariableare named after JSON for a reason and are untouched. -
createCustomFieldlists the field types it accepts.typewasstringwhile its own documentation named all twenty-one built-in types, andsearcherKeybeside it had been an enum all along — the difference being that Atlassian put that one's values in the specification and this one's only in prose:await jira.issueFields.createCustomField({ name: 'Story points', type: 'com.atlassian.jira.plugin.system.customfieldtypes:float', });
The type stays open, which here is not a formality: a site carries plugin and Forge field types —
com.atlassian.jpo:jpo-custom-field-parent,com.pyxis.greenhopper.jira:gh-sprint— that no list of Atlassian's will ever name, and every one of them still compiles.Two of the twenty-one are in the list only because the description was read twice. Atlassian's own bullets leave the value of
multicheckboxesandmultigrouppickerempty and givemultiselectandmultiuserpickertheir neighbours' values, so reading the stated values alone drops two real types — one of which,multiuserpicker, a live site answers with.
General
- A parameter type built on a model is written as one call. 139 of them read
z.object({}).extend(BoardCreateSchema.shape)— an empty object, then everything merged onto it. They arez.object(BoardCreateSchema.shape)now. The schema is the same object either way, and nothing about the types changes; it is the generated sources that were harder to read than the thing they describe. - The writes are covered live now. All three uploads store an image against the test site and delete it again, the filter, account and site-wide column endpoints are set and restored, and the avatar just uploaded is read back through
getAvatarImageByID— the two halves proving each other. None of this had a single test before, which is how a body typed as an object survived a major release. - The live test for these endpoints was passing without testing anything. It looked for
avatarId=in a project'savatarUrls, which give the path form and carry no such parameter, so the match failed, the test returned on its second line, and every assertion below it — including the one aSchemaMismatchErrorwould have failed — was unreachable. That is why this shipped. The test now takes its avatar id fromgetAllSystemAvatars, asserted non-empty by the test above it, and has no branch that can turn it off; the two remaining image endpoints are covered as well.