I have a connection from project A in a cloud instance and project B in another data center version instance. I need to synchronize the value of a field called ETA. The fields are Date Picker type.
but when it comes to synchronizing the fields, it is synchronized in project B one day before what was placed. Does anyone know how I can solve this with the Date Picker type field?
Before sending the query I read the post but according to what is in the post they did not solve the issue.
I found something similar in a post with the Due date field, I tried to change the code to this one but it doesn’t work, do you know if the case can be solved at the code level?
if (replica.customFields.“DatePicker”) {
def dateValue = replica.customFields.“DatePicker”.value // Extract actual date
if (dateValue) {
// Remove time part if present (keep only YYYY-MM-DD)
def cleanedDate = dateValue.toString().split(" ")[0]
// Parse as LocalDate
def parsedDate = java.time.LocalDate.parse(cleanedDate)
// Add 1 day
def adjustedDate = parsedDate.plusDays(1)
// Convert to Java Date object (required for Jira fields)
def sdf = new SimpleDateFormat("yyyy-MM-dd")
def finalDate = sdf.parse(adjustedDate.toString()) // Convert to Date object
// Assign the corrected Date object back to Jira
issue.customFields."DatePicker".value = finalDate
}
}
In case of needing to Subtract 1 day
def adjustedDate = parsedDate.plusDays(1)
to
def adjustedDate = parsedDate.minusDays(1)