I would like to show a custom message from a Javascript file. Like this:
But with a custom message. There's any "trigger" for this?
function something(){
JIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]);
// show a custom message here.
}
You can show a custom message like this:
AJS.messages.info("#a-custom-context", {
title: 'This is a title in a default message.',
body: '<p> And this is just content in a Default message.</p>'
});
You can read more info here:
From the link I gave you:
There are a few ways to implement messages: using HTML (or Soy to generate the HTML) or using JavaScript.
1. using HTML
<div class="aui-message aui-message-error">
<p class="title">
<strong>Error!</strong>
</p>
<p>And this is just content in a Default message.</p>
</div>
All you need to insert this div into html code and hide it. Then when needed you can show it
2. Use Java Script. You do not need to create a div. You just call this Java Script code:
AJS.messages.info({
title: 'This is a title in a default message.',
body: '<p> And this is just content in a Default message.</p>'
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried, but nothing happens.
I need to install anything on my JIRA application?
AJS.messages.info({
title: 'Testing.',
body: '<p>Testing, testing, testing...</p>'
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where did you put the code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I understand.
First, i need to insert a html element (a div, for example).
And then, use this "div" to create the message?
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.