Hi Team,
We are using JMWE add-on for sending the Email notification when request reaches the certain steps.
In Postfunction we added the conditions to get the Email Address(To Address).Pls find below Screenshot.
Our Requirement is, we want add around 50-60 conditions to get 'To address' based on request value. we want to achieve this with out any performance issues such as high load time.
Could you pls help how to achieve this with out any performance issue using JMWE add-on.
Thanks,
Loganayaki
Hi @Loganayaki
there won't be any performance impact with your implementation, but for readability purposes, you can alter it as such:
<%
def parent = issue.get("customfield_32924")?.get("null")?.value
def child = issue.get("customfield_32924")?.get("1")?.value
switch(parent) {
case "DAC":
switch(child) {
case "SERVE Rule Request": print "test1@abc.com"; return
case "Credit Rule Request": print "test2@abc.com"; return
default: print "default@abc.com"; return
}
case "SomethingElse":
switch(child) {
case "SERVE Rule Request": print "test1@abc.com"; return
case "Credit Rule Request": print "test2@abc.com"; return
default: print "default@abc.com"; return
}
default: print "default@abc.com"; return
}
%>
HI @David Fischer ,
It is working. Thanks for your help. :)
But I have one question. why we have to print the the value , instead of returning the value?
I have tried below script . but it is not working.
switch(child) {
case "Test1": return "abc@xyz.com"
case "Test2": return "defg@xyz.com"
default: return "support@xyz.com"
}
Thanks,
Loganayaki R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's because I used a <% ... %> block instead of a <%= ... %> block. The problem with <%= %> is that it expects a single expression, not a block of statements. There are ways around it, but I thought it'd be easier to use a <% %> block instead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.