Dear all,
I am trying to read a value from a table, in order to find out which user to apply as watcher.
If I run the sql statements directly in database, the results are correct.
Although, when I am trying to do it though jira sil it does nothing.
I am sending you the script below and please let me know if you find something that I should change.
Below the script:
include "C:\\Program Files\\Atlassian\\Application Data\\JIRA\\silprograms\\postfunctions_functions.incl";
logPrint("DEBUG","stp_assign_to_maker.sil:Started");
string cif=cf_cif_value;
string account=cf_account_value;
string fcubsUsername;
string ROwatcher;
string watcher1;
if (cif=="") {
cif="000000";
}
if (account=="") {
account="0000000000000";
}
string selectSQL="SELECT a.RM_ID FROM ancoria.flx_sttm_customer a, ancoria.flx_sttm_cust_account b WHERE a.customer_no = b.cust_no and b.cust_ac_no = ?";
string[] relationShipOfficers = sql(silEnv("kposJDNI"), selectSQL, account);
string[] usernames;
//no relationship officer assigned to customer so assign to maker
if (size(relationShipOfficers) > 0) {
fcubsUsername=relationShipOfficers[0];
}
selectSQL="select user_name from ancoria.smn_users b where fcubs_user_name=?";
usernames = sql(silEnv("kposJDNI"), selectSQL, toUpper(fcubsUsername));
if (size(usernames) >0) {
watcher1=usernames[0];
ROwatcher=watcher1;
watchers = addElement(watchers, ROwatcher);
}