Attribute Content Model
The content in Elements Checklist panels is typed. This means that when reading or writing content, you will be proposed types data corresponding to the attribute types in the panel.
For example, you will find numbers, users, project components, etc...
There are two groups of data types, primitives and entities.
- Primitive types represents the most basic values like numbers, dates, strings.
- Entities types represents more complex types identified by an id. Only entity references are stored in panels, so entities can be missing when reading a panel.
Primitive types
Attribute type | AttributeContent sub class | Value type | Content format | Restrictions |
---|---|---|---|---|
Text | TextAttributeContent | java.lang.String | Raw text on a single line. | No HTML allowed (escaped). Line breaks are removed. |
Multiline text | MultiLineTextAttributeContent | java.lang.String | Text in markdown format | The markdown language is used to format the display. |
Number | NumberAttributeContent | java.lang.Double | Decimal number value | |
Calculated | NumberAttributeContent | java.lang.Double | Decimal number value | This is not a stored attribute, but the result of a calculation |
ErrorAttributeContent | java.lang.String | Raw text | The calculate attribute can return an error when a calculation error happens. The text contains the error message. | |
Checkbox | BooleanAttributeContent | java.lang.Boolean | Boolean value | |
Date | DateAttributeContent | java.util.Date | Date value |
In this table:
- Attribute type represents the type of attribute defined in panel configuration
- AttributeContent subclass represents the java type returned by the PanelItemContent.getAttributeContents() or by the PanelItem.getAttributeContent(AttributeRef attributeRef) methods
- Value type is the type of value returned by the attribute content
Entity types
Attribute type | AttributeContent sub class | Entity type | Entity id type | Multiple |
---|---|---|---|---|
User | UserAttributeContent | com.atlassian.jira.user.ApplicationUser | User key (String value) | No |
Select | SelectListAttributeContent | com.valiantys.software.elements.api.model.SelectOption | Option id (String value) | Yes |
Project component | ProjectComponentAttributeContent | com.atlassian.jira.bc.project.component.ProjectComponent | Component id (Long value) | No |
Project version | VersionAttributeContent | com.atlassian.jira.project.version.Version | Version id (Long value) | No |
Issue attachment | AttachmentAttributeContent | com.atlassian.jira.issue.attachment.Attachment | Attachment id (Long value) | Yes |
Issue | IssueAttributeContent | com.atlassian.jira.issue.Issue | Issue id (Long value) | No |
In this table:
- Attribute type represents the type of attribute defined in panel configuration
- AttributeContent subclass represents the java type returned by the PanelItemContent.getAttributeContents() or by the PanelItem.getAttributeContent(AttributeRef attributeRef) methods
- Entity type is the type of entity returned by the attribute content.
Multiple
When an attribute is marked 'multiple', this means that it returns a list of entities (java.util.List) instead of a single entity