rule notification about created issue when becomesReported() { ..... if (Customer email != null) { sendMail(Customer email, "Autoreply:" + " [" + getId() + "] " + issue.summary, " \" \", : [" + getId() + "]<br> : " + now.format(mediumDateTime) + "<br> . <br><br> , .... ..") } }
when comments.added.isNotEmpty { ...... // Last comment author null, if (Last comment author != null) { sendMail(Last comment author, "Autoreply:" + " [" + getId() + "] " + issue.summary, " c \" \" : [" + getId() + "]<br> : " + now.format(mediumDateTime) + "<br> . <br><br> , c ....."); } ....... Last comment author = null; }
when becomesReported() { ..... // issue.deadline = now + 24 hours; if (issue.deadline.format(#e) == 6) { issue.deadline = issue.deadline + 48 hours; } if (issue.deadline.format(#e) == 7) { issue.deadline = issue.deadline + 24 hours; } ..... // var bank = ""; var ce = ""; ce = issue.Customer email + "~"; bank = ce.substringBetween("@", "~"); if (issue. == null) { if (bank == "somebank.domain.com") { issue. = {- }; } ....... } }
rule CloseFromBankRequest when issue.hasTag(" ") { if (issue.hasTag(" ")) { debug(" " + issue.getId()); if (issue.Type == {Bug}) { // , if (issue.desc == null) { issue.desc = issue.summary; } if (issue.solution == null) { issue.solution = " "; } issue.ballis = {}; issue.polygon = {}; issue.causer = {}; if (issue. == null) { issue. = { }; } issue.Timer = {}; } else { if (issue.desc == null) { issue.desc = issue.description; } if (issue. == null) { issue. = { }; } issue.ballis = {}; issue.Timer = {}; } } }
rule VoteCloseIssues when issue..changed { if (issue. == {Fixed} && (issue.Type == {Bug} || issue.Type == {Task})) { var preview = " . <br><br> , [" + getId() + "] . <br> , <a href=\"mailto:support@bifit.ua?subject=[" + getId() + "] " + summary + "&body= \"></a> . <br><br> ? <br><a href=\"http://{link_to_web_interface}/report/Issues.php?api=vote&id=" + getId() + "&mark=good\">, </a><br><a href=\"http://{link_to_web_interface}/report/Issues.php?api=vote&id=" + getId() + "&mark=bad\">, </a><br><br> :<br><br>"; var i = 0; var author_comment = ""; var subj_comment = " [" + getId() + "]"; var text_comment = ""; var date_comment = now.format(mediumDateTime); var full_text = ""; while (issue.comments[i].text != null || i < 10) { author_comment = issue.comments[i].author.fullName; date_comment = issue.comments[i].created.format(mediumDateTime); text_comment = wikify(issue.comments[i].text); // if (issue.comments[i].permittedGroup == null && issue.comments[i].text != null) { full_text = "<b>" + author_comment + ":</b><br> : " + date_comment + "<br><blockquote>" + text_comment + "</blockquote><br><hr><br><br>" + full_text; } i = i + 1; } full_text = full_text + "<b>" + ":</b><br> : " + issue.created.format(mediumDateTime) + "<br><blockquote>" + wikify(issue.description) + "</blockquote><br><hr><br><br>"; full_text = preview + full_text; sendMail(Customer email, subj_comment, full_text); } }
when issue..changed
When changed the value of the field "Status". if (issue. == {Fixed} && (issue.Type == {Bug} || issue.Type == {Task}))
If the status is “Closed” and the task type is “Bug” or “Consultation”. preview
The beginning of the text of the letter. There is a notification about closing the task, links to the assessment (the same web interface and api). while (issue.comments[i].text != null || i < 10)
Let's go through the last 10 comments and add the author, the text of the comment in full_text (this is the history of correspondence) full_text = full_text + "<b>" + ":</b><br> : " + issue.created.format(mediumDateTime) + "<br><blockquote>" + wikify(issue.description) + "</blockquote><br><hr><br><br>";
In the history, the most recent comment will be the first appeal of the bank wikify (issue.description) sendMail(Customer email, subj_comment, full_text);
Send all this to the bank. rule set_subsystem_if_change_gateway when issue. .changed { if (issue.Subsystem != { } && issue. != null) { issue.Subsystem = { }; } }
schedule rule check deadline every minute [issue.Timer != {} || issue. == {Fixed}] { if (issue.deadline == null || issue. == {Fixed} || issue.ballis == {}) { // , if (issue.hasTag("")) { issue.applyCommand(" "); } // , } else if (issue.deadline <= now) { // , "" if (issue.hasTag("")) { if (issue.hasTag("")) { issue.applyCommand(" "); if (issue.isoverdue == {}) { issue.isoverdue = null; } } // ( ) } else { if (!issue.hasTag("")) { issue.applyCommand(" "); if (issue.isoverdue == null) { issue.isoverdue = {}; } } } } }
schedule rule pause all issues in overtime daily at 18:15:00 [issue.Timer == { }] { issue.Timer = {}; }
Source: https://habr.com/ru/post/247939/
All Articles