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