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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
number days;
date startDate =
"2012-01-10 12:00:00"
;
date endDate =
"2012-01-20 10:30:00"
;
string startHour =
"09:00"
;
string endHour =
"17:00"
;
number[] weekend = {
7
,
1
};
date[] holidays = {
"2012-01-18"
,
"2012-01-16"
};
number
hours = getWorkingInterval(startDate, endDate, startHour, endHour, weekend, holidays);
days = hours/8;
return days;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it should be like this:
number days;
date startDate =
created
;
startDate = startDate + "1d";date endDate =
"2012-01-20 10:30:00"
;
string startHour =
"09:00"
;
string endHour =
"17:00"
;
number[] weekend = {
7
,
1
};
date[] holidays = {
"2012-01-18"
,
"2012-01-16"
};
number
hours = getWorkingInterval(startDate, endDate, startHour, endHour, weekend, holidays);
days = hours/8;
return days;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, this is also the solution I came up with. Last question ^^, how to make the counter stop once the status has been resolved, and continue while it remains unresolved? Thank you for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You would need to combine the script above with this one:
https://confluence.cprime.io/display/TR/Get+time+spent+in+certain+status+per+issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.