ManishaP
Just expanding on Jussi's solution to add the prefix with the steps I've used
1. Add a SPEL trigger to a \\NX_ROOT\site\mods\majic\ *.mods file (you need to create the mod file or use an existing site defined one). E.g. MODIFY cr POST_VALIDATE zcreate_prefix(ref_num, type) 117 FILTER(EVENT("INSERT"));
NOTE: I'm using POST_VALIDATE... you can use PRE_VALIDATE
2. Add the SPEL method that the trigger calls to a \\NX_ROOT\site\mods\majic\*.spl file
//member method that adds a prefix to the cr ticket number
cr::zcreate_prefix(...) {
string ticNum, ticType, zmethod;
zmethod = "cr::zcreate_prefix()";
ticNum = argv[3];
ticType = argv[6];
if(ticType == "I") {
ticNum = format("I-%s", ticNum);
} else if(ticType == "P") {
ticNum = format("P-%s", ticNum);
} else if(ticType == "R") {
ticNum = format("R-%s", ticNum);
}
send_wait(0, this, "call_attr", "ref_num", "set_val", ticNum, "SURE_SET");
if (msg_error()) {
logf(ERROR, "%s: Unable to modify ref_num value", zmethod);
return;
}
}
3. Recycle services and test