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


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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

800 views 2 19
Join discussion

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