Hey guys,
I´m trying to add a notification to my post function. Unfortunately it is not displayed, when the post function is fired. Is there any additional setting in Jira to "enable" it or am I doing it wrong? Or can´t it be executed within a Post function?
I tried with the following code:
import
com.onresolve.scriptrunner.runner.util.UserMessageUtil
UserMessageUtil.success(
"Hello world"
)
Thank you very much guys!
I have more interesting/crazy situation: in my code I have a number of places where I'm calling a user message, and only one or two of them are showing them. I can't understand what is the difference.
It seems that user messages generated with UserMessageUtil only work in situations where the browser refreshes the current page.
Example:
.) Create a listener for "Issue commented" that raises a user message -> Try to comment an issue -> user message will not be shown, because the page is not completely refreshed
.) Create a post-function for a workflow transition, in which you raise a user message -> fire this transition in any issue -> user message will be shown, because the page has been refreshed
.) Create a post-function for a workflow transition, in which you programmatically add a comment to an issue (this will trigger the "Issue commented" listener I suggested above) -> fire this transition in any issue -> user message will be shown, because the page has been refreshed (user message has been created by the "Issue commented" listener!)
Maybe this helps you finding out why your code doesn't work as expected!
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 your advice, but...
To be clear, in my post the words "in my code" means than I have ONE script (listener) and A NUMBER of calls UserMessageUtil in it. Few of them are running fluently, and some ... I never saw them (but log.debug messages shows that they were executed).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any answer on this? I'd also like to use UserMessageUtil or an equivalent to display a message to the user, but the "import" line causes an error (unable to resolve class).
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To be more precise, we are running version 5.6.3.2.
The error I get is:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you ever get an answer to this? I'm seeing the same issue with Automation for Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the same issue.
I've found that it does work when placed in a Validator script, but not in an Automation for Jira script. It seems the point at which is it called effects it.
Update: I tried triggering a listener that contains the notification code from Automation. Still no joy.
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.