Hi, I want to create custom field to count the age/workday based on the creation date field, excluding the Holidays and Week ends. Can anyone help? I am using Jira-cloud. Thanks!
Hello,
The Cloud architecture does not support scripted custom fields, that is why you can not do it on Cloud.
Thanks for the answer. But as of now, we are using plug-ins to add SIL in some of the custom field. Now I want to add custom field wherein I can count the days since the issue has been created, excluding holidays and weekends.
I am not sure how you add a sil script to a custom field in Cloud. But if you can do it, then you should use this function:
date startDate =<span> </span>"2012-01-10 12:00:00";date endDate =<span> </span>"2012-01-20 10:30:00";string startHour =<span> </span>"09:00";string endHour =<span> </span>"17:00";number[] weekend = {7,<span> </span>1};date[] holidays = {"2012-01-18",<span> </span>"2012-01-16"}; number hours = getWorkingInterval(startDate, endDate, startHour, endHour, weekend, holidays);<br>days = hours/8;<br>return days;number days;
date startDate =<span> </span>
"2012-01-10 12:00:00"
;
date endDate =<span> </span>
"2012-01-20 10:30:00"
string startHour =<span> </span>
"09:00"
string endHour =<span> </span>
"17:00"
number[] weekend = {
7
,<span> </span>
1
};
date[] holidays = {
"2012-01-18"
"2012-01-16"
number
hours = getWorkingInterval(startDate, endDate, startHour, endHour, weekend, holidays);<br>days = hours/8;<br>return days;
Thank you! This helped. I got another query, how can I make it possible to start the counting the number of workday on next day? E.g. When issue was created today, the start of counting of workday will be tomorrow.
It looks like you're new here. Sign in or register to get started.