Numerical Comparison against Assets Schema Attribute

Benjamin Leidner
Contributor
May 16, 2024

I'm totally stuck and hoping someone here can help me.

A user fills in a custom field in a Jira screen named "Total Contract Cost" (number field)

I have all my users in Assets in my "Max_Spend" schema.  This has the attributes "Name", "Email" (etc.) and "Purchase Approval Limit"

I need an automation to compare the value in the field against the value in Assets to determine if the employee is allowed to spend that amount, and provide a deny message if

"Total Contract Cost" > "Purchase Approval Limit."

Any experts have a solution?  Thanks so much!

-Ben

1 answer

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2024

You can do the compare using smart values and numerical compare, in your case it would look something like this:

{{#=}}{{issue.Contract Cost.lte({{object.Purchase Approval Limit}}){{/}}

This would return true if the cost is equal or lower than the limit.

Benjamin Leidner
Contributor
May 16, 2024

Thank you so much for this!  But where/how do I enter this logic?

In my automation, I have:

When: Issue created--

Then: Lookup Objects in MAX_Spend [Schema]

Query: objecttype = "NS_Employee_Spend" and "Name" IN ("{{issue.customfield_10073.join("\",\"")}}")

So I grab the "Purchase_Approval_Limit" from Assets but where do I put the comparison logic so it prevents the transition and throws the appropriate error message?

Thanks so much.

-Ben

Benjamin Leidner
Contributor
May 16, 2024

Max Spend.jpg

Benjamin Leidner
Contributor
May 16, 2024

vend 02.jpg

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2024

You have two options, one is to create a new smart value and then use the IF condition to see if the smart value is true of false. The other option is to use the IF condition and compare the two values using the smart value compare. The issue with this is that you cannot use <=, it only has less then. 

Benjamin Leidner
Contributor
May 20, 2024

Got it, thank you!  And with a nice transition screen, too.

SNAG-2947.png

Like Mikael Sandberg likes this

Suggest an answer

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

Atlassian Community Events