Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Api
  • Queries
  • Context

Last edited by Andrea Pavlovic Dec 09, 2021
Page history

Context

To correctly get the instances which are available for an attribute of a transition which is a reference, the query context must be defined.

Example: to find out which entites (attribute "entity") a user may set as the base entity for a new saved query (transition "add" on "extensions.query"), this will find the answer:

POST #/data/system/entity/query

{
  "context": { 
    "module" : "extensions", 
    "entity" : "query", 
    "transition" : "add", 
    "attribute" : "entity"
  }
}

If, in this list, the instance with id 5 is listed, this will be a valid request:

POST /data/extensions/query/transitions/add

{ 
  "entity" : 5,
  #other parameters
  
}

This is necessary because

  1. depending on the workflow, some references may not be available
  2. the user may not have access to all references

Remember that this is just one of the options a query takes, it can still be combined with all the others (page, conds, attrs etc).

{
  "context": {
    "module": "core",
    "entity": "unit",
    "transition": "site_admin_create",
    "attribute": "parent"
  },
  "conds": {
    "name": {
      "-like": "S%"
    }
  }
}
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages