Hi,
I’m trying to use the Forge storage system, but I’m having a hard time, even looking deep into the documentation.
I’m trying to follow https://developer.atlassian.com/platform/forge/custom-entities-store-structured-data/
And it’s a UI kit 2 app
I got up to:
manifest:
storage:
entities:
# Define a custom entity for storing project groups
- name: 'jiraproject-group'
attributes:
groupname:
type: 'string'
projectkey:
type: 'string'
indexes:
# Index to query project groups by name
- name: 'by-groupName'
range:
- 'groupname'
- name: 'by-projectkey'
range:
- 'projectkey'
got this to run without error (don’t know if it did anything ):
const projectGroupData = {
groupname: groupName,
projectkey: project.key
};
await storage
.entity(jiraprojectGroupEntityPath)
.set(`group-${uuidv4()}`, projectGroupData);
}
But when I call:
const query = await storage
.entity(jiraprojectGroupEntityPath)
.query()
.index('by-groupname')
.where(WhereConditions.beginsWith(searchQuery))
.getMany();
I get:
Error: There was an error invoking the function - Variable "$range" got invalid value null at "range.values[0]"; Expected non-nullable type "AppStoredCustomEntityFieldValue!" not to be null.
Am I missing something with storage definition? Partition? I’m a bit fuzzy now.