I created new custom field wherein it can automatically gives the Pre UAT date based on the created date and SLA. But the condition is, once the initial Pre UAT date was missed or passed due and the issue is still not resolved, there'll be another option wherein Pre UAT can be manually written. How to insert code for manual input of date? And also, I want to consider the weekends and Holidays in getting the "Pre UAT" Date.
I am not a developer and unfamiliar with the language so I will really appreciate your help. Thanks!
Here is what I wrote:
date PreUAT;
string[] SLA = "customfield_10056";
//number SLA = Severity;
date startDate = created + "1d";
string startWorkingHour = "09:00";
string endWorkingHour = "18:00";
number[] weekendDays = {7,1};
date [] holidays = {"2018-12-25", "2019-01-01", "2019-02-05", "2019-02-06", "2019-04-19", "2019-05-01", "2019-05-19", "2019-06-05", "2019-08-09", "2019-08-11", "2019-10-27", "2019-12-25"};
number hours = getWorkingInterval(created, currentDate(), startWorkingHour, endWorkingHour, weekendDays, holidays);
if ("customfield_10056" == "1-Showstopper"){
PreUAT = "1d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}
else if ("customfield_10056" == "2-Major"){
PreUAT = "4d" + startDate;
if (PreUAT < currentDate()){
}
return PreUAT;
}
else if ("customfield_10056" == "3-Medium"){
PreUAT = "7d" + startDate;
if (PreUAT < currentDate()){
return PreUAT;
}
}
//missing manual input & consider weekends holidays
Hello,
1, If you want a user to enter a date, then you should create a screen with a date custom field. Then you get the value of this field in your script.
2, You already provided holidays in your script. Why is it not enough?
Hi Alexy,
1. I already added Date picker custom field. Is it possible to make it automatic based on the formula and can be manually set at the same time?
2. As much as possible, I don't want to make the holidays hard coded, so it can be easily modified in the future. Cause these dates are only applicable next year, and if they want to change it at least they won't need to touch the coding.
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.