Forums

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

Please help me setup Current Date attribute which is in my Laptop assets to be set as todays date

Anosha Fatima Fazli December 23, 2024

I have an attribute in my asset management laptops object named "Current Date". I want to assign it todays date by default. Then I have attribute Current Status (Months) Where I want to calculate number of months by taking difference of attributes current date - purchase date.

please tell me how can i do thos

2 answers

1 vote
Jeroen Poismans
Community Champion
December 23, 2024

Hi and welcome to the community!

 

Can you elaborate on the use case because storing a current date on a laptop, whuy would you do that? You would have to update all laptops every day?

Please explain what you are trying to achieve.

Anosha Fatima Fazli December 23, 2024

Hey so we have date of purchase which will be manually set by us. Then we want to have current date which should by default change everyday.
This is because we want to calculate the End of life of devices (in months) which will be current date - date of purchase.

FYI-I want these attributes to be in only assets and not use anywhere in the issues/fields

0 votes
Christopher Yen
Community Champion
December 23, 2024

Hi @Anosha Fatima Fazli 

Would the out of the box created date on the asset align with what you're looking for in Current Date?

I think I tried something similar, in our situation we have an "Assigned Date" field when we assign a computer to an employee and then we wrote a global rule to calculate the difference between "Assigned Date" and Current Date each day and wrote the result to an "Asset Age" field to help determine if the asset was eligible for an upgrade. The main obstacle we ran into was that global automations on assets seems to have a limit on the number of objects it can run on that's very small, it will only update like 50 assets or less each run so when asset counts reach into the thousands this is not a scalable solution.

What I've learned after is that onboarding assets works best when tied to a issue/request workflow in JSM with default and required fields and then have an automation create and link the asset, or import from another source like an MDM or discovery tool. To report on things like contract date or upgrade eligibility I rely on AQL searches or exporting to sheets/excel to get that data. 

Apologies if I'm misunderstanding your situation though, please correct me if I'm wrong

Anosha Fatima Fazli December 23, 2024

hey i guess you have understood it fine but I do not want to use these attributes anywhere in fields/issues.

 

I just want them to be associated to assets. Is there anyway for that?

Christopher Yen
Community Champion
December 25, 2024

I think just having a purchase date field you can accomplish the rest using AQL to query 

Anosha Fatima Fazli December 25, 2024

and where can I write the AQL query for asset attributes? if you can please guide on the steps

Christopher Yen
Community Champion
December 26, 2024

Screenshot 2024-12-26 103202.png

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