Dynamic Catalogs with AQL for Personalization
Welcome to our guide on using Jira Assets and Shoppie to create dynamic catalogs tailored for diverse global markets and company departments. Customizing your catalog to reflect regional and departmental needs not only enhances the customer experience but also boosts internal efficiency and collaboration.
In this guide, we'll show how to structure Assets to link products with users in specific regions or departments using inbound or outbound references. This ensures each team has the necessary tools to excel in their roles, promoting a more productive and unified operation.
Regions
First up you’ll need to set up different regions around the world where the company operates. Start by creating an object type called e.g “Region” and create objects inside of it.
Department
After the regions are created we will create a list of departments. These departments will be parts of the organizations where different users work at. We only need to create object types and we don’t need attributes for this specific use case. You should be left with something like this:
People
After the region and department object types are created we will switch our focus to users.
Create a object type called e.g “People” which will store all users inside of the company and their details.
There are 3 important attributes needed for the “People” object type:
Location/Region → this is a object attribute type that will be an outbound reference to the region user is located in.
Actual user → User select attribute. Important to get the actual user ID
Department → Department user is located in, e.g finance or legal. Will be used in another example. This attribute is also a object
The people objects should look something like this when done:
Products
Last but not least you will need a list of items/products that are available for users and that will be displayed on the JSM portal.
Create an object type called “Devices” or in this example it’s called “Laptops”.
Along the usual device details there are two important attributes here, both attributes are objects that will be used as an outbound reference to a department and region:
Regional availability → Attribute used to define in which regions is this product available for
Department → Attribute used to define for which departments the device is available for
The screenshot below shows user(object) details and its connection to regions, departments and products. The user is a part of a certain region and department and the products are available in certain regions and for certain departments.
AQL filtering of products per region
After Assets are all set up and inbound and outbound references configured we come to the crucial part of this use case, the AQL filter. First up we’re gonna explore the AQL filter for filtering products based on their availability in a region.
The following AQL filter is used:
object HAVING outboundReferences(ObjectType = "Region" AND object HAVING inboundReferences("Actual user" = currentUser()))
What this AQL filter does is it looks at product object and checks the reference to which region is the product available in. After that’s checked it takes a look if the currently logged in user is part of that region and on that basis displays the item for that user or doesn’t.
AQL filtering of products per department within a region
To expand on the previous use case we will now go a step further. We will filter out products which will be available for the currently logged in user in the catalog depending on which department the user is a part of and in which region the user operates in.
The following AQL filter is used:
object HAVING outboundReferences(ObjectType = "Department" AND object HAVING inboundReferences("Actual user" = currentUser())) AND object HAVING outboundReferences(ObjectType = "Region" AND object HAVING inboundReferences("Actual user" = currentUser()))
This AQL filter checks the product for which department is available for and checks which users are in that department. After than the AQL filter checks for which region is the item available for and once again checks if the currently logged in user operates in that region.
Catalog configuration
The catalog can be configured freely as you see fit in regards of importing products, defining the default attributes, stock(inventory management), item details etc. For a full list of possibilities take a look at this page.
Our point of interest is the AQL filter option in the category configuration. The filters mentioned above will be entered in the field:
The result is that within the same catalog different items will appear for different users based on their location and/or department: