Forums

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

How to use the plusBusinessDays function in Jira automation against the created variable?

Jayson2 Contreras February 17, 2025

Hi everyone,

 

Good day!

 

I am creating an automation rule that will set the value of custom field "Planned Execution Date" to the date when an issue was transitioned from "In Draft" to "In Progress" plus one business day. And this needs to be run retrospectively. I was able to do until setting the value of "Planned Execution Date" to the date when an issue was transitioned from "In Draft" to "In Progress", but couldn't use the plusBusinessDays function to the created variable. Does anyone know how to make this work?

Here's the screenshot of the rule I'm creating:Screenshot 2025-02-18 111452.png

Thank you in advance.

 

Regards,

Jayson

2 answers

1 accepted

5 votes
Answer accepted
Vishal Biyani
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.
February 17, 2025

@Jayson2 Contreras 

you need to specify the format with toDate. So, something like below

{{plannedDate.toDate("yyyy-MM-dd").plusBusinessDays(1)}}

 

You may have to play with date format based on what you have.

 

Jayson2 Contreras February 17, 2025

Hi @Vishal Biyani

 

Good day!

 

Thank you for this information. I used this and it worked.

 

Regards,

Jayson

Like Vishal Biyani likes this
2 votes
Trudy Claspill
Community Champion
February 17, 2025

Hello @Jayson2 Contreras 

Created variables are always stored as strings regardless of the original value types used to set the variable. Each time you want to use the variable with a date/time related function you must first convert the string to a date.

Bill Sheboy has previously indicated that the to date function could be used.

https://community.atlassian.com/t5/Jira-questions/Smart-Values-String-type-conversion-to-Date/qaq-p/2106719

Jayson2 Contreras February 17, 2025

Hi Trudy,

Thank you very much for this info.

Regards,

Jayson

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