Forums

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

Using Jira Asset management (and automation) to track Asset amortization/deprecation

Azur Mujezinovic July 3, 2023

Hi everyone !

Is there any way I can track amortization period for assets, through automation.

Basically, I have already added an attribute type "Date" to some assets.

Now I want to create an automation where this date will be checked, and upon (for an example) 6 months of "expiration", I want to send an email.

Basically, it sounds simple but I could not find a way to make it work. I need to check if current date - date on attribute <= 6 months

If yes, send email, otherwise ignore.

Thank you all,

Azur

1 answer

0 votes
Evgenii
Community Champion
July 3, 2023

Hi, @Azur Mujezinovic 

If I'm not mistaken, there is Automation in Assets, where you can add new rule, and by schedule (every day) look for assets, where Date is => startOfDay() AND <= startOfDay(6M)

After that, if such assets are found, rule must create email and send it.

Azur Mujezinovic July 4, 2023

Hi Evgeniy ,

Indeed, there is a scheduler in Global Automation but I keep getting "Invalid JQL" error when trying to specify objectSchema = "IT CMDB"

Any ideas ? 

Thank you,

Azur

Evgenii
Community Champion
July 4, 2023

Hi, @Azur Mujezinovic 

"Invalid JQL"? It looks like, you're trying to configure Jira Automation with JQL search. 

You need to use action "Lookup objects", to find required assets.

image.png

Azur Mujezinovic July 4, 2023

Hi @Evgenii .

 

Thanks for the quick reply.

Yes, I get the lookup objects, and can print them out but am having troubles with date comparison now.

Attribute "Manufacturing date" is added with type "Date" from the UI of Assets itself.

I thought {{now.diff(lookupObjects."Manufacturing Date").abs.months}} would work, but it does not.

I tried printing what this would return (through send email), but it sends just the blank row.

 

Thank you.

Regards

Evgenii
Community Champion
July 4, 2023

You can try to use another type of comparison, like:

lookupObjects."Manufacturing Date" >= startOfDay() AND lookupObjects."Manufacturing Date" <= startOfDay(6M) 

Azur Mujezinovic July 4, 2023

What type of condition should I include that to ? 

If / else block does not take smart values (which I would need for {{lookupObjects."Manufacturing Date"}}, right ?Screenshot 2023-07-04 at 14.19.24.png

Evgenii
Community Champion
July 4, 2023

I think, you need to use AQL conditins.

Can you show all rule, that you created?

Azur Mujezinovic July 4, 2023

There are just 2 simple steps created.

When : Scheduled, monthly

Then : Lookup objects, from IT CMDB,

Condition : currently not using it because I an trying to get the right output in email, in order to know what is returned.

Send email. Email body is just me testing the outputs.

Azur Mujezinovic July 4, 2023

Screenshot 2023-07-04 at 14.46.40.pngScreenshot 2023-07-04 at 14.46.49.png

Evgenii
Community Champion
July 4, 2023

Hm, I think I understood the problem.

You have to look for assets (your second screen, Lookup Objects) with AQL search, and then use list of objects in email.

objectType = _your_assets_type_ AND "Manufacturing Date" >= startOfDay() AND "Manufacturing Date" <= startOfDay(24w)

Here is example, how to use lookup objects list:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-insight/#SmartvaluesInsight-Lookupobjects

image.png

Like Azur Mujezinovic likes this
Azur Mujezinovic July 5, 2023

Thanks for the help.

Managed to solve it with just a bit different approach.

Wanted to include the age of an asset in the email body too. 

Screenshot 2023-07-06 at 08.38.43.pngScreenshot 2023-07-06 at 08.39.35.png

Like Evgenii likes this

Suggest an answer

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

Atlassian Community Events