Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I display a "success" pop up message as a result of a Webwork Action?

Alessandro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 15, 2020

Good morning,

I'm developing a small Jira plugin and I have created a simple Webwork Action (extending JiraWebActionSupport) that takes some data from an input form, makes some business logic and returns a result (success or failure).

 

Instead of returning a new page (like success.vm, for instance), I would like to just show a pop up message (like these) with a custom text.

 

I've tried to use the JiraWebActionSupport's methods addMessageToResponse and returnMsgToUser, but the resulting page shows no messages.

 

Am I doing something wrong? Should I maybe add some Javascript or HTML to the resulting page template to show the message?

1 answer

0 votes
DH
Contributor
January 3, 2022

In your plugin javascript, giddy up on this:

JIRA.Messages.showSuccessMsg('Returned Success',{closeable: true, timeout: 10});

more verbose:

function updateConfig() {
$.ajax({
url: url,
type: "PUT",
contentType: "application/json",
data: JSON.stringify({ key: $("#key").val() }),
processData: false
}).success(function(data, textStatus, jqXHR) {
JIRA.Messages.showSuccessMsg('Returned Success',{closeable: true, timeout: 10});
});

 

It will display the Jira message at the top of the page - like you've seen before - and then remove the message after 10 seconds.

Suggest an answer

Log in or Sign up to answer