Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SILL scripts help

Gbenga Ajiboye
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 26, 2019 edited

In my environment "TDB Security Member" custom field has been designed to capture the ID of the "current active user" whenever a user accesses an issue.  So now, although the user is not actively making a change, this field is an open read field that is immediately capturing user ID information and updating.  Just wondering if there a way to re-architect a solution where the TDB Security Member field does not report a new value every time any user accesses an issue?

here is the attached TDB Script for "issue security approval"

if(TDBSecurityApprover==""){
TDBSecurityMember = currentUser();
}
if(!userInGroup("TDB Security Elevated Approvers", currentUser()))
{
// lfDialogMessage(currentUser(),"ERROR") ;

lfDisable("TDBSecurityMember");
}

switch(currentUser()){
case "bd1959"://Brandon
lfDisable("TDBMemberDecisionBrandon");
// lfDialogMessage("Security Approved by Brandon", "ERROR") ;
break;
case "ab1484"://Seth
lfDisable("TDBMemberDecisionSeth");
// lfDialogMessage("Security Approved by Seth", "ERROR") ;
break;
}

 

//lfWatch("TDB Security Member", {"TDB Security Member", "TDB_security_approver"}, " SecurityApproverWatch.sil", {"change"});

 

another script attached is 

"SecurityDecisionChange"

string securityMember = TDBSecurityMember;
string c_user = currentUser();
JFieldChange[] changes = getFieldChanges(key, "TDB Security Decision");
// lfDialogMessage(changes, "ERROR");
JFieldChange latestChange = changes[0];
date newest = latestChange.changeDate;

for (JFieldChange change in changes) {
if (change.changeDate > newest) {
latestChange = change;
}
}

//lfDialogMessage(latestChange, "ERROR");

JFieldChange[] securityMember_changes = getFieldChanges(key, "TDB Security Member");
// lfDialogMessage(securityMember_changes, "ERROR");
JFieldChange latestSMChange = securityMember_changes[0];
date newestSM = latestSMChange.changeDate;

for (JFieldChange change in securityMember_changes) {
if (change.changeDate > newestSM) {
latestSMChange = change;
}
}
//lfDialogMessage(latestSMChange, "ERROR");
JUser lastSM = getUserByFullName(latestSMChange[4]);
lfDialogMessage(lastSM[0], "ERROR");

if(TDBSecurityDecision!=latestChange[4]||TDBSecurityMember!=lastSM[0]){
//lfDialogMessage("Security Decission Changed", "ERROR");
if(userInGroup("TDB Security Elevated Approvers", currentUser())&&currentUser()!=securityMember){
c_user=securityMember;
}else{
TDBSecurityMember=c_user;
}

switch(c_user)
{
case "bd1959"://Brandon bd1959
TDBSecurityApprover=c_user;
// lfDialogMessage("bd1959", "ERROR");
lfDisable("TDBMemberDecisionBrandon");
break;
case "ab1484"://Seth ab1484
TDBSecurityApprover=c_user;
// lfDialogMessage("ab1484", "ERROR");
lfDisable("TDBMemberDecisionSeth");
break;
default:
TDBSecurityApprover=c_user;
}
}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events