Attribute Types
Every AttributeDefinition returned by meta.v1 carries an attributetype attribute whose value is one of the following.
List of Attribute Types
| Attribute Type | Data Type | Description |
|---|---|---|
| Boolean | boolean | true or false |
| Numeric | double | floating point number |
| Date | datetime | date and possibly time |
| Duration | string | a string with syntax N UnitType where N is an integer and UnitType is Days, Weeks, or Months |
| Text | string | string limited to 4000 characters |
| LongText | string | string limited by database. Often contains html or rich text |
| Relation | Oid | a relationship to another asset |
| Rank | Rank | An arbitrary object that represents one rank object relative to another |
| AssetType | AssetType | the name or token of an asset type |
| Opaque | Opaque | An internal value that has no external meaning. |
| State | integer | The asset's lifecycle state. Rendered as a number by rest-1.v1 and by name everywhere else; see AssetState values. |
| Password | string | A string that represents the password for a login. A password attribute type is write-only. It can never be retrieved. |
| Blob | Blob | A stream of binary data such as the content of an Attachment asset. |
AssetState Values
Every asset carries AssetState, a State attribute. The stored value is
a byte; the named values are the meaningful points on it:
| Value | Number | Meaning |
|---|---|---|
Future | 0 | Not yet active (a story in a future timebox, a scope not started). |
Active | 64 | In use. |
Closed | 128 | Closed; for a List value, inactive. |
Dead | 192 | Retired. |
OldBrokenDownStory | 208 | A story that was broken down under the old breakdown model. |
Deprecated | 254 | Deprecated. |
Deleted | 255 | Deleted. Excluded from reads unless deleted=true (rest-1) or IsDeleted is queried. |
The endpoints do not agree on how to render it. rest-1.v1 renders the
number (<Attribute name="AssetState">128</Attribute>, "value": 128 in
JSON); query.v1 and api/asset render the name ("AssetState": "Closed"). There is no way to ask rest-1 for the name: AssetState is a State, not
a relation, so AssetState.Name and AssetState.Code are rejected
(Unknown token), and a list value's RollupState (Status.RollupState)
renders as a number too. What rest-1 does offer readably is the derived
booleans IsClosed, IsDead, IsDeleted and IsInactive; otherwise map
the number with the table above. A client that reads through more than one
endpoint should normalise to the name once, at the edge, rather than
compare a 128 from one call with a "Closed" from another.
Filters accept either spelling, and they are not plain comparisons. On every endpoint:
- The value may be a name (case-insensitive) or a number that is one of
the seven codes:
AssetState='Closed',AssetState='closed'andAssetState='128'are the same filter. An unknown name is rejected (Invalid QueryFilter2 token), but a number that is not one of the codes is accepted and compared exactly:AssetState='200'finds templates. - Only
=and!=are allowed.AssetState<'Closed'is rejected (InequalityNotSupported), even though the value is a number underneath. - Equality on a name is a band, not a point:
Futurematches anything below 64,Activeanything from 64 up to 128,Closedfrom 128 up to 192,Deadfrom 192 up to 255, andDeletedexactly 255. SoAssetState='Dead'also matches an asset stored as 200 or 208.OldBrokenDownStoryandDeprecatedmatch their exact code. !=on a name means below the band's start, which is where the ordinary filters get their meaning:AssetState!='Closed'is "state < 128" (Future and Active only; it excludes Dead and Deleted too),AssetState!='Dead'is "state < 192" (everything not retired or deleted),AssetState!='Active'is "below 64 or 128 and above".- A list ORs the bands (
AssetState='Active','Future'), and a negated list ANDs the negations.