Configured sending of e-mail in post-function configured the condition for sending the scriptrunner did not accept and send the e-mail for all issues even the condition without errors.
In the three tests the email was sent skipping the condition as if it did not exist.
First test - issue.reporter == 'Cybersecurity.telefonica'
Second test - issue.reporter? .name == 'Cybersecurity.telefonica'
Third test - cfValues ['Grupo Solucionador'] == 'SegurancaInformacao_BM'
I need an email to be sent when
issue.report = 'Cybersecurity.telefonica' and Grupo Solucionador = 'SegurancaInformacao_BM'
issue.reporter method is returning an ApplicationUser value so the comparison with String value might not be working.
Please try this way and I can confirm is working on my side:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def userManager = ComponentAccessor.userManager
ApplicationUser user = userManager.getUserByName("Cybersecurity.telefonica")
user == issue.reporter
I hope this helps :)
Hi @John Chin
The scriptrunner continues to send e-mail in all situations, the condition is ignored, I need the e-mail to be sent only when reporter == 'Cybersecurity.telefonica', did not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I mentioned, please use this script on the scriptrunner condition:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def userManager = ComponentAccessor.userManager
ApplicationUser user = userManager.getUserByName("Cybersecurity.telefonica")
user == issue.reporter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Linton Tomaz da Silva can you share screenshot of your configuration pls?
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.
Thank you for the screenshots... it looks good so far. What if you press "preview"? What is the result? There should be information about condition and if it was true or false.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, when clicking on preview the displayed message is correct, see
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.
@Linton Tomaz da Silva it looks like attachment/screenshot was not uploaded.
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.
Ok, are you sure you Published your workflow? It is not enought to Save the postfunction's configuration. You also need to publish the workflow.
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.