Forums

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

issue in budling the script

saikiran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 21, 2024

Hi team,

In between two status we had one transition with a validator with below mentioned built using script runner on On-premise environment.

 

def devcomplDate = cfValues['Development Completion Date'] def currentDate = new Date().minus(1) devcomplDate > currentDate

 

Now, I want to replicate the same script in Cloud environment. can some one help me in building/ replicating the same script in cloud environment.

 

Thanks 

saikiran 

1 comment

Comment

Log in or Sign up to comment
Tuncay Senturk _Snapbytes_
Community Champion
November 22, 2024

Hi @saikiran 

It'd be something like this

import java.time.LocalDate
import java.time.ZoneId

def devcomplDate = cfValues['Development Completion Date'] as Date

if (devcomplDate == null) {
return false
}

def devcomplLocalDate = devcomplDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
def yesterday = LocalDate.now().minusDays(1)
return devcomplLocalDate.isAfter(yesterday)

 

TAGS
AUG Leaders

Atlassian Community Events