Forums

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

Jira smart value datetime | date + X

Peter Skokan January 30, 2024

Hello all,

i'm trying to get Duedate base on value from assets, but i can't get any date at all..
here is my test enviroment  :
automations :
Duedate : {{now.plusDays(issue.Contract.Invoice Expiry Days).jiraDate}},
{{issue.Contract.Invoice Expiry Days}}
{{now.plusDays(14).jiraDate}},

 

this is output :
Duedate : ,
14
2024-02-13,


as well i try to use another approach with creating variable,  with needed number 14 but result is same...
can anyone help me ? or suggest some other possible solution ?
Thank you .

2 answers

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
January 30, 2024

Hi @Peter Skokan 

What is the field type for Invoice Expiry Days?

If it is text, you may need to add asNumber to convert it inside of the function call.

Kind regards,
Bill

Peter Skokan January 31, 2024 edited

Hello @Bill Sheboy currently it's  INTEGER so most likely this will not be issue. :-/

Bill Sheboy
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.
January 31, 2024

What is the source of that field?  For example, is it a marketplace addon, and so may be a dynamically evaluated field?

For fields like that, the must first be set to a created variable to capture the value...as they often will not work inside of functions.  And then the variable may be used in the function, converting to a number for your scenario.

Peter Skokan January 31, 2024

what field you mean?  issue.Contract.Invoice Expiry Days  ? it's object in Issue field that is linked to Assets.  i do not use any additional Apps or addosn,

and your suggestion to variable, i try that as well but result is the same,  is there some possibility to check if variable is number?

Duedate with variable: {{now.plusDays(cas).jiraDate}},
{{cas}}
OUTPUT :
Duedate with variable: ,
14


and by default is the logic i using correct ?? it's possible to replace "14" with variable as i trying here {{now.plusDays(14).jiraDate}} ??  i did not found any specific documentation about this topic i just assume it could work, and it not showing any error ...

Bill Sheboy
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.
January 31, 2024

Yes, that was the field I was asking about: {{issue.Contract.Invoice Expiry Days}} 

I have not worked with assets and rules, and so I wonder if because their lookups are dynamic that it is not evaluated in time for passing to the function.  So continuing to use the variable will help: based on your audit log results it is evaluated and saved.

Variables are text, and so I noted adding a conversion to use it as a number.  Like this:

{{now.plusDays(cas.asNumber).jiraDate}}

 

Peter Skokan January 31, 2024

THANK YOU !!!!!!!

{{now.plusDays(cas.asNumber).jiraDate}}


missing "asNumber" works !

Like • Bill Sheboy likes this
Bill Sheboy
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.
January 31, 2024

Awesome; I am glad to learn that helped!

0 votes
Harsh
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.
January 30, 2024

Hi @Peter Skokan 

 

Could you please explain what exactly you want to achieve. It is not clear what you want to achieve.

Thanks

Peter Skokan January 31, 2024 edited

Hello @Harsh ,

I sending web POST request to invoice API, where i generating invoice payment, but i have different Invoice Expiry Days for different customers, so i want to use my variable from assets to send correct DueDate to invoice API
basically this is correct output when expire days is set to 14 :
{{now.plusDays(14).jiraDate}},

but the expire days is various .
i hope i explain it properly.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events