We have a multiselect custom field that is being used as part of the condition conrolling the Send a Custom Email post function. Here is what is in the condition
cfValues["Send to Logrequest"].toString() == "Yes"
What is needed is to be able to reset this custom field to "No" or none after the email is sent. Adding the 'Clear Field Value' post function from the JIRA Suite Utilities plugin results in no email. Also tried the 'Set Field Value to constant or Groovy expression' from the JIRA Misc Workflow Extensions pluginwith the same result of no email being sent. And out of desperation added
<% cfValues["Send to Logrequest"] = null %>
to the end of the message template. Still no email.
A general question about post functions. Are they executed in the order displayed? Or some other order?
Any idea how to accomplish this? Thanks in advance.
Check the order of post function execution.
Send custom email post function should executed before clear field value.
So if clear field value is executed first no email is sent.
You can change the order of post functions by click on the arrows. Check the screenshot below.
Hope that helps
The Send a Custom Email post function appears ahead of any of the other post functions that try to clear/reset the custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Possibly your condition is wrong
try the following
cfValues['Send To Logrequest']*.value.contains('Yes')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Send Email post functions *works* if the post function that tries to set/clear the custom field is removed. This has always been the case. It is as if the post functions are being excuted in parrallel or out of order.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just reproduced it. You are right. Doesn't work if clear field value post function is used. No idea why this happens...
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.
You could try a god-awful hacky workaround. Immediately fter the send email function, add a custom script post-function, which just contains:
Thread.sleep(700)
obviously this will delay the transition by half a second, but it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kostas is right on the condition script... it might work for you but it will also return true if the select contains something like "goldeneyes" - case notwithstanding.
It's because the send mail function starts a new thread, then pauses and sends the mail, to deal with a jira bug: https://jamieechlin.atlassian.net/browse/GRV-284
But your use case is valid, create an issue so you can track when it's done and I'll deal with it. But it will go in to the next major version... I'm not backporting anything at the moment.
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.
Is there any other workaround available? I have the same issue with a script that alters the comment AFTER the custom email is sent. As the email uses the comment initially I need to keep the original comment with the sleep(700) before I alter it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi i also had a similar problem but fixed it with the following function in scriptrunner:
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.