How to lookup Objects on an Assets Objects field using values from a Select List (multiple choices) field in Automation

Still need help?

The Atlassian Community is here for you.

Ask the community


 

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

   

Environment

  1. Have a Select List (multiple choices) that correspond to attributes in your Objects
  2. Use that field on your Request Type form, instead of the actual Assets Objects field
  3. Customers will often select more than one option

Problem

A Select List (multiple choices) field smart value {{issue.customfield_xxxxx}} cannot be used in an IQL to find the correct objects due to how the automation will output the list of options selected.

For instance, let's assume that a customer selected the following options for their office desk setup: Macbook Pro, 24in Monitor, Wireless Mouse, Wireless Keyboard. Using the {{issue.customfield_xxxxx}} smart value in a Label IN ({{issue.customfield_xxxxx}}) IQL, we'd get the following actual IQL:

Label IN (Macbook Pro, 24in Monitor, Wireless Mouse, Wireless Keyboard)

However, as those options have spaces in them, that IQL syntax is invalid, and the automation will throw an error.

Solution

We need to manipulate that list to have each option inside double quotes.

For that, we can use the following smart value:

{{#issue.customfield_xxxxx}}"{{value}}"{{^last}},{{/}}{{/}}

Using the same example above, that smart value will give us the following IQL:

Label IN ("Macbook Pro", "24in Monitor", "Wireless Mouse", "Wireless Keyboard")

With that list properly separated and with double quotes, the IQL should work properly and allow Assets to find the proper objects.


Last modified on Aug 23, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.