Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

931 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you