Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional smart values in automation to update Assets Object Attribute

Rune Rasmussen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2024

Hello

I am attempting to set up a process where a Jira Request is submitted, automation is triggered, and attributes on an Assets Object is updated.

The catch is that the Jira Request will contain many fields that all correspond to many attributes on my object, but all fields will not always be filled in, as not all attributes will need to be updated.

I want to avoid just using branches in the automation, as the finished product is expected to have around 20-40 attributes, which would cause the automation to exceed the (arbitrary?) limit of 65 "components" pr. automation rule.

So instead I'm attempting to use Smart Values to only conditionally update the Object Attributes.

While setting up my PoC I am using the Issue Description to update an Object Attribute called "Description".

In my automation action that edits the Object Attribute I have attempted the following values:

{{#if(exists(issue.description))}}{{issue.description}}{{/}} - To only update the Object Attribute if the description exists.

{{#if(issue.description.length > 0)}}{{issue.description}}{{/}} - To only update the Object Attribute has a length greater than zero characters.

{{#if(not(issue.description.isEmpty))}}{{issue.description.size}}{{/}} - To only update the Object Attribute if the issue description is not empty.

{{#if(issue.description.length > 0)}}{{issue.description}}{{/}}{{^issue.description.length > 0}}{{object.description}}{{/}} - Provided by ChatGPT, in an attempt to fallback to the original Description attribute value if the Issue Description has no value).

But no matter what I do, when my Issue Description is empty, the Object Attribute is overwritten with nothing (in other words, it's cleared).

So... Am I attempting the impossible, or am I missing something?

1 answer

1 accepted

0 votes
Answer accepted
Rune Rasmussen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 3, 2025

Just to answer my own question, in case anyone else runs into this as well.
My solution ended up being this:

{{if(forms.last.description.equals(""),lookupObjects.Description,forms.last.description)}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events