Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Get different SLA information

Roman Akhmetov May 21, 2019

That's my SIL script:

string[] CL_issues_K1;
string[] issues_K1 = selectIssues("\"SLA_1\" = breached()  and created > startOfDay(-2)");

string[] CL_issues_K2;
string[] issues_K2 = selectIssues("\"SLA_2\" = breached() and created > startOfDay(-2)");

for(string iss in issues_K1){
    CL_issues_K1 = createIssue("CL_SLA", "", 11604, %iss%.summary);
    %CL_issues_K1%.customfield_15116 = "SLA_1";
    %CL_issues_K1%.assignee = %iss%.assignee;

    JSlaInformation[] slaInfos = getSlaInformation(iss);

    for(JSlaInformation slaInfo in slaInfos){
      JSlaOngoingCycle slaOC = slaInfo.ongoingCycle;
      %CL_issues_K1%.description = "||KEY: |" + %iss%.key + "\n" + "||NAME: |" + slaInfo.name   + "\n" + "||START: |" + slaOC.startTime + "\n" + "||END: |" + slaOC.breachTime + "\n" + "||TIME: (в минутах) |" + slaOC.goalDuration/60000 + "\n" + "||LEFT: |" + slaOC.remainingTime;
    }
}

for(string is in issues_K2){
    CL_issues_K2 = createIssue("CL_SLA", "", 11604, %is%.summary);
    %CL_issues_K2%.customfield_15116 = "SLA_2";
    %CL_issues_K2%.assignee = %is%.assignee;

    JSlaInformation[] slaInfos = getSlaInformation(is);

    for(JSlaInformation slaInfo in slaInfos){
      JSlaOngoingCycle slaOC = slaInfo.ongoingCycle;
      %CL_issues_K2%.description = "||KEY: |" + %is%.key + "\n" + "||NAME: |" + slaInfo.name +   "\n" + "||START: |" + slaOC.startTime + "\n" + "||END: |" + slaOC.breachTime + "\n" + "||TIME (в минутах): |" + slaOC.goalDuration/60000 + "\n" + "||LEFT: |" +   slaOC.remainingTime;
    }
}

 

But for that issues in SLA_1 and SLA_2 i got only SLA_2 information. Why only SLA_2?

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events