Uploaded image for project: 'Jira Service Management Cloud'
  1. Jira Service Management Cloud
  2. JSDCLOUD-10236

Assets Automation: Smart values for an object's user/object attribute using list functions such as size/isEmpty do not work with a single value

XMLWordPrintable

      Summary

      Smart value for an object's user or object type attributes any list type function such as size does not work with a single value

      Steps to Reproduce

      1. Create an Insight object with a user attribute "Assigned". Set cardinality to multiple users.
      2. Create an automation rule to be triggered when an object is created and print the value of below smart value
        {{object.Assigned.size}}  
        
      1. Create two objects, one with a single user and the other with 2 users

      Expected Results

      The automation rule prints 1 and 2 respectively.

      Actual Results

      The automation rule for an object with a single user returns empty. While it works fine when you have more than 1 user added.

      Notes

      For user picker fields in Jira, for example, Approver, it works with one user:

      {{issue.Approvers.size}}
      

      Workaround

      Steps:
      1. Add action "Create variable" to capture object User attribute, i.e: issue.assetfield.user_attribute or object.user_attribute
      2. Then use the below smart value to capture the size:
        {{if(variable_name.isEmpty(), 0, variable_name.split(",").size)}}
      Reference documentation:
      Loom/Recording:

      Workaround test: JSDCLOUD-10236 Workaround.mp4

              98313b92c163 Bhavya Pathipati
              skahol Swati Kahol (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              17 Start watching this issue

                Created:
                Updated:
                Resolved: