Custom alert message on issue create/edit

Whenever an issue is created or edited, JIRA pops up a message in the top right corner, like below:

image2017-1-3 23:30:24.png

I want to either display my own message in addition to that or modify the existing one based on the value of a scripted field.  My scripted field is an AUI message (following the instructions here https://scriptrunner.adaptavist.com/4.3.0/jira/recipes/scriptfields/informationMessage.html), and it shows up perfectly on the issue.  I just need the same message in a popup alert as well, on issue create and issue update.

I tried using UserMessageUtil in a scripted listener, but that does not work.  It seems like UserMessageUtil is only meant for validators.

What is the recommended approach for this?

5 answers

This widget could not be displayed.

So after some testing, I added a scripted listener for Issue Created and Issue Updated, as follows:

import com.onresolve.scriptrunner.runner.util.UserMessageUtil
 
UserMessageUtil.success("This is a test message.")

Originally, I thought it wasn't working at all, but now I see that it works but at the wrong time.  For instance, if I hit update on the issue, nothing shows up, but then if I open another issue in the issue navigator, the test message shows up.  Same with issue create–if I create an issue, nothing shows up, but if I refresh the page or navigate to another issue, the message shows.  

It's like the timing of the event is off.  Does anyone else experience this?

Thanks a lot this worked like a charm.

This widget could not be displayed.

Hello,

the code available on the repo below is also working with this dialog box, it might be of some help :

https://github.com/sappho/jira-issue-quick-start/blob/master/src/main/resources/js/issue-quick-start.js

But beware that it's not the same box that is provided by the SR info message (in the issue view, always visible on the issue) and this dialog box (in javascript, reacting on some event).

 

 

Thanks for the response.  How do I setup that JS code to execute on issue create / update?

Hi 

Can you please tell us that where to add this JS?

 

Thanks and Regards,

Vaishal

This widget could not be displayed.

Another observation: if the scripted listener is assigned to "All Projects" instead of a specific project, then the timing is off only SOMETIMES.

Overall, it's behaving very oddly.

This widget could not be displayed.

@Irtiza Rizvi Hi, could you provide a bit more details on how you use the AUI message (https://scriptrunner.adaptavist.com/4.3.0/jira/recipes/scriptfields/informationMessage.html)) ? 

Is it possible to use it with behaviours ? I would like the user to get a popup after evaluating a field on the issue.

Thanks !

Antoine

This widget could not be displayed.

@Irtiza Rizvi Hi,

Did you end up solving the issue with the wrong message timing? I encountered the same problem, used a script in post function, called the message Util and only when I use issue view it works well, when I use other window, i.e right click on issue options, it is not triggering.

I wondered if you found a solution to this?

tx,

Esty

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

54 views 1 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you