Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,055
Community Members
 
Community Events
168
Community Groups

Smart Values String type conversion to Date

Edited

How can I convert a correctly formated (yyyy-MM-dd) string into a Date so that Date and Time operations like minusDays(1).toBusinessDayBackwards behave as expected and return a result.

When smartYear = 2022 & smartMonth = 01 & smartDay = 19

smartParsedDate = {{smartYear.concat("-").concat(smartMonth).concat("-").concat(smartDay).toDate().as("yyyy-MM-dd")}}

 

Results in {{smartParsedDate}} equaling "2022-01-19"

as per https://community.atlassian.com/t5/Jira-questions/Parse-a-datestring-in-a-smartvalue/qaq-p/1879743

however {{smartParsedDate.minusDays(1)}} returns an empty string as does

{{smartParsedDate.toBusinessDayBackwards}}

1 answer

1 accepted

1 vote
Answer accepted

Hi @Jason Gardner 

Please try converting the text string to a date value first, such as with:

{{smartParsedDate.toDate}}

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events