Is thete any "week" custom field?

Hello people,

is there any week custom field available in JIRA, or some add-on for that?

I would like to have a field where I can select a calandar date (ie: Feb/19th/2014) and the field stores W7 value, or Week7.

Of course I can create a select list with W1 - w53, but users will be confusing.. because they need to convert their dates into week format manualy.


1 answer

1 accepted

1 vote
Accepted answer


Nice question, This can be done,

How are we going to achieve ?

You will be having a datepicker custom field and you need to create a select list with W1 - w53, in datepicker customfield we are going to add a javascript, which will automatically select the week.

But You have to add javascript.Please check the below javascript.

These code which are below will come inside the date picker custom field .This is for getting the week

Date.prototype.getWeek = function () {

// Create a copy of this date object

var target = new Date(this.valueOf());

// ISO week date weeks start on monday

// so correct the day number

var dayNr = (this.getDay() + 6) % 7;

// ISO 8601 states that week 1 is the week

// with the first thursday of that year.

// Set the target date to the thursday in the target week

target.setDate(target.getDate() - dayNr + 3);

// Store the millisecond value of the target date

var firstThursday = target.valueOf();

// Set the target to the first thursday of the year

// First set the target to january first

target.setMonth(0, 1);

// Not a thursday? Correct the date to the next thursday

if (target.getDay() != 4) {

target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7);


// The weeknumber is the number of weeks between the

// first thursday of the year and the thursday in the target week

return 1 + Math.ceil((firstThursday - target) / 604800000); // 604800000 = 7 * 24 * 3600 * 1000


This is for getting the week from datepicker customfield and setting it in the week customfield


var today = $("#datecustomfield").getDate();

var week = "W"+today.getWeek();

$("#weekcustomfield option[text="+week+"]").attr("selected","selected");


Hope this helps you!

Thank you Nitram. I did not test it yet, but I got the idea.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,355 views 14 19
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you