Page tree

This documentation relates to an older version 5.1 of the Structure for Jira. Visit the current documentation home.

Skip to end of metadata
Go to start of metadata

1. Minor Java API Release

There are a few moderate changes coming with this release. The changes are backwards-compatible, so any code using API 16.x should work fine.

Jira Version

New API Version

7.2+

16.6.0

See Structure API Versions for full version information and downloads.

2. Compatible Changes in the Java API

2.1. Attribute API changes

Support for aggregation over subtree part has been added. Four subtree part kinds are supported:

  1. CHILDREN – direct children only

  2. LEAVES – leaf forest rows only

  3. STRICT – full subtree without root node

  4. SUBTREE – full subtree

Constants are declared in CoreAttributeSpecs.Param; behavior is described in ReductionStrategy. One can apply behavior to loader by subclassing ReducingAggregateLoader and overriding ValueReducer.reduce method (and other ValueReducer methods if convenient). Chosen subtree part is specified by AttributeSpec parameter 'type' (CoreAttributeSpecs.Param.TYPE) and defaults to SUBTREE.
List of subtree-part-aware loaders in api module:
  • LongSumLoader (changed)

  • NumberSumLoader (changed)

  • AbstractDistinctSumLoader (changed)

To support this change some other changes have been made:

  • Since distinct loaders can now accept parameters DistinctAttributes.NON_UNIQUE_ITEMS_SPEC has been deprecated and DistinctAttributes was marked as @Internal.

  • Handy SingleDependencyReducingAggregateLoader (subclass of ReducingAggregateLoader) was added.

  • Class SecureSingleDependencyReducingAggregateLoader aggregates values from subtree part, replacing value to AttributeValue.undefined() if user shouldn't have access to data by security reasons.

  • AttributeLoaderSecurity encapsulates security checks. Can be used when SecureSingleDependencyReducingAggregateLoader isn't applicable.

  • AttributeValue.isEmpty() is a shortcut for !AttributeValue.isDefined() && AttributeValue.getLoaderData(Object.class) == null

  • AttributeValue.ofNullable() is a shortcut for value == null ? AttributeValue.undefined() : AttributeValue.of(value)

  • NumberAccumulator.toNumber() is a shortcut for NumberAccumulator.toValue().getValue()

  • AbstractAggregateLoader.firstChildError() method traverses errors through AttributeLoader.Aggregate. Used to transmit formula errors (other loaders currently don't supply error values).

2.2. ForestSpec-sensitive attributes

Attribute values can now depend on the forest spec for which the attribute is requested. Two new methods have been added to AttributeContext to support this:

  • getBaseForestSpec() returns the ForestSpec, if there is one;
  • getBaseStructureId() returns the structure ID part of the base forest spec.

Also there is a new version of StructureAttributeSpec.getAttributeValues(), marked @Internal.

The Notes column introduced in Structure 4.1 now uses the base forest spec instead of the structureId parameter, which has been removed.

2.3. Jira Service Desk Request Type support

A constant and a static method have been added to support the Request Type from Jira Service Desk as a separate item type:

  • CoreItemTypes.REQUEST_TYPE
  • CoreIdentities.sdRequestType()

2.4. Miscellaneous

  • Added GenerationContext.getForestSpec(), which returns the forest spec being generated.

  • ValueFormat.ANY, introduced in version 16.5.0, is now supported by the REST API.

  • Added new versions of ForestAccessCache.getInvisibleRows() which accept LongSizedIterable as input. The old methods accepting LongList are now @Deprecated, kept only for binary compatibility.

  • ArrayForest.moveSubtreeAtIndex() now returns -1 if no move is needed, i.e. the subtree is already at the given location.

  • @NotNull and @Nullable annotations have been added in multiple places to clarify nullability contracts.