Forums

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

Calculation with dates and numbers - Asset Automation

Maria Elena Lovato August 23, 2024

Hi, I'm trying to calculate a couple of attributes of an object type in the Asset plug in using dates and number.

I have two different type of calculation I need to do:

  • difference of dates, so Date A- Date B = Number of days (21/08/2024 - 01/08/24 = 20)
  • find a new date starting from Date A and adding a number of days (01/08/24 + 20 = 21/08/2024)

I don't know where to find infos on the language used in the automation from asset.

 

I also cannot use external stuff and other plug in from Atlassian Marketplace.

1 answer

0 votes
Marc - Devoteam
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.
August 23, 2024

Hi @Maria Elena Lovato 

Check out this community article: Calculate-months-between-two-dates 

 

 

Maria Elena Lovato August 26, 2024

Hi Marc, my problem is this is not related to issues but to Asset, so I'm not quite sure how to use it in this context. Do I have to use the asset placeholders (e.g.: ${start date}) in the formula? How do I replace the "issue" in the formula, with "object"?

Marc - Devoteam
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.
August 26, 2024

Hi @Maria Elena Lovato 

You can't. 

You can use smart values within AQL, but not the other way around.

You would require to have custom fields that show asset information, to use it in an automation as a calculation.

Maria Elena Lovato August 27, 2024

So it's not possible to set up an automation which calculate something?

Marc - Devoteam
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.
August 27, 2024

Hi @Maria Elena Lovato 

Yes you can use automation for calculation, but only on number values stored in custom fields.

You are not able to directly use attribute values from assets in calculations, within an automation rule.

You would need a custom field of the type assets that uses the assets. Then create a variable that stores the numeric assets value, then you can use the variable as a smart value in a calculation

Maria Elena Lovato August 27, 2024

And how do I create custom field whitin Asset?

Marc - Devoteam
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.
August 27, 2024

Hi @Maria Elena Lovato 

See the KB article here; set-up-the-assets-object-field 

But You will need a premium subscription to use the assets feature.

But I missed something, you are using an asset app from the marketplace, not the native assets option.

Then it is possible that this is not possible. Check the docs of the app if the app integrates with automation.

Suggest an answer

Log in or Sign up to answer