Forums

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

JIRA shows different workweek for same date for system dates and custom field dates

Amita Sarkar
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!
June 16, 2021

Hi All,

Kindly help with the below issue .

In production, we see a weird issue of the Same dates (11 Feb 21) displayed as different Workweek for the different custom fields. (Pic Attached)
Created is shown as 11/Feb/21 (WW7.4)
Schedule Start Date as 11/Feb/21 (WW6.Thur)

1.Created is System dates and Schedule Start Date is custom field using Date picker and using JAVA APIs.DateIssue.png
2.Further, dates and times are stored internally in JIRA's database and depend on the timezone of the database. Our DB is configured as 1st Jan 2021 as WW1 and Sunday as the first day of the week. (Not as per ISO standard).

We want to have consistency in the dates and follow how created, updated, and resolved dates are displayed for all the Date custom field.

 

 

Solution tried in script console.
1. Fetching the schedule start date after the issue is created
2. Manipulating it as per NOT ISO standard. (code snippet added below). Output is correct in the script console.
3. Setting it back with the new date. No change in the WorkWeek.

Can you suggest how can we overcome this issue?

Code Snippet
CustomField actualStartDateCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Actual start date");

//get Calendar Instance
Calendar gc = Calendar.getInstance();
//SET as per Production DB
gc.setMinimalDaysInFirstWeek(1);
gc.setFirstDayOfWeek(Calendar.SUNDAY);
gc.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
gc.setTime(dueDate);
//Get the new date
Date newDueDate = gc.getTime();
log.error("new due date = " +newDueDate)
log.error("Due date WW = " + gc.get(Calendar.WEEK_OF_YEAR));
//WorkWEEK shown is correct

def dueTimestamp = new Timestamp(gc.getTimeInMillis())
issue.setDueDate(dueTimestamp);
//After setting NO change in workweek in JIRA view

 

Thanks 

Amita

1 answer

0 votes
Markus Kaml
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!
July 29, 2021

Hello together,

we have the same issue described below and urgently need a solution.

Best regards

Markus

Suggest an answer

Log in or Sign up to answer