Below is the code.
MODIFY chg POST_VALIDATE zUpdateChangetype_OnRiskChange() 660 FILTER(risk{});
chg::zUpdateChangetype_OnRiskChange(...)
{
string isStandCat;
int catLength;
if (!is_null(category)) {
catLength = strlen(category.sym);
isStandCat = substr(category.sym,catLength-3,catLength);
if (isStandCat == "STD"){
logf(SIGNIFICANT,"zUpdateChangetype_OnRiskChange:category %s and isStandCat %s",category.sym,isStandCat);
if (chgtype.sym == "Standard") {
if ( is_null(chgtype) || chgtype != 100)
send_wait(0,this,"call_attr","chgtype","set_val","100","SURE_SET");
}
}
else {
if (risk.sym == "Critical" && priority.sym == "1"){
if (is_null(chgtype) || chgtype != 300) {
send_wait(0,this,"call_attr","chgtype","set_val","300","SURE_SET");
}
}
else if (risk.sym == "Critical" && priority.sym == "2"){
if (is_null(chgtype) || chgtype != 200){
send_wait(0,this,"call_attr","chgtype","set_val","200","SURE_SET");
}
}
else if (risk.sym == "Critical" && priority.sym == "3") {
if (is_null(chgtype) || chgtype != 200) {
send_wait(0,this,"call_attr","chgtype","set_val","200","SURE_SET");
}
}
else if (risk.sym == "Major" && priority.sym == "1") {
if (is_null(chgtype) || chgtype != 200) {
send_wait(0,this,"call_attr","chgtype","set_val","200","SURE_SET");
}
}
else if (risk.sym == "Major" && priority.sym == "2") {
if (is_null(chgtype) || chgtype != 200) {
send_wait(0,this,"call_attr","chgtype","set_val","200","SURE_SET");
}
}
else if (risk.sym == "Major" && priority.sym == "3") {
if (is_null(chgtype) || chgtype != 100) {
send_wait(0,this,"call_attr","chgtype","set_val","100","SURE_SET");
}
}
else if (risk.sym == "Minor" && priority.sym == "1") {
if (is_null(chgtype) || chgtype != 200) {
send_wait(0,this,"call_attr","chgtype","set_val","200","SURE_SET");
}
}
else if (risk.sym == "Minor" && priority.sym == "2") {
if (is_null(chgtype) || chgtype != 100) {
send_wait(0,this,"call_attr","chgtype","set_val","100","SURE_SET");
}
}
else if (risk.sym == "Minor" && priority.sym == "3"){
if (is_null(chgtype) || chgtype != 100) {
send_wait(0,this,"call_attr","chgtype","set_val","100","SURE_SET");
}
}
}
}
}