Hi,
I need my plugin to show a message like the one after you created a issue.
"Issue XXX has been successfully created."
My plugin is a web-item+webwork.
I tried it by adding styleClass to my web-item:
<styleClass>custom-context</styleClass>
web-resources:
<web-resource key="last-check-updater-resources" name="last-check-updater Web Resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="last-check-updater.css" location="/css/last-check-updater.css"/> <resource type="download" name="last-check-updater.js" location="/js/last-check-updater.js"/> <resource type="download" name="images/" location="/images"/> <context>last-check-updater</context> </web-resource>
.js:
AJS.messages.generic("#custom-context", { title:"Custom Context Demo", body: '<p>Because you often need to specify where the message goes.</p>' });
But the message doesn't show up.
Is it the right way to do own messages or is there some other solution?
Community moderators have prevented the ability to post new answers.
I assume you want to display a message box after your action is completed , right ?
If yes , you will need to add a script somthing similar to this in the .vm file which is returned after the action (webwork).
I don't use a .vm for this plugin. My plugin just updates a custom field and I want to display a notification after it's done. Is it possible to start .js from java?
Maybe start the .js as return in the below method?
public String doUpdate() throws Exception { if (customFieldManager.getCustomFieldObjectByName(LastCheckUpdater.CUSTOM_FIELD_LAST_CHECK) != null) { issue = getCurrentIssue(); lastCheckField = customFieldManager.getCustomFieldObjectByName(LastCheckUpdater.CUSTOM_FIELD_LAST_CHECK); fieldLayoutItem = fieldLayoutManager.getFieldLayout(issue).getFieldLayoutItem(lastCheckField); lastCheckFieldValue = issue.getCustomFieldValue(lastCheckField); modifiedValue = new ModifiedValue(lastCheckFieldValue, new Timestamp(new Date().getTime())); lastCheckField.updateValue(fieldLayoutItem, issue, modifiedValue, new DefaultIssueChangeHolder()); } return returnComplete("/browse/"+getCurrentIssue().getKey()); }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add a view to your webwork plugin module .. this view will be a VM file in that vm file you can add a js which will display a message . refer the webwork plugin module documentation
https://developer.atlassian.com/display/JIRADEV/Webwork+plugin+module
see the view attribute
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my atlassian-plugin.xml:
<web-item name="Last-Check-Button" i18n-name-key="last---check---button.name" key="last---check---button" section="operations-top-level" weight="19"> <description key="last---check---button.description">The Last-Check-Button Plugin</description> <label key="last---check---button.label"/> <link linkId="last---check---button-link">/secure/LastCheckWebWorkAction!Update.jspa?id=${issue.key}</link> <tooltip key="last---check---button.tooltip"/> <conditions type="and"> <condition class="com.capgemini.plugins.jira.webwork.RiskIssueCondition" /> <condition class="com.atlassian.jira.plugin.webfragment.conditions.IsIssueUnresolvedCondition" /> </conditions> <styleClass>last-check-updater</styleClass> </web-item> <webwork1 key="last-check-web-work" name="LastCheckWebWork" i18n-name-key="last-check-web-work.name"> <description key="last-check-web-work.description">The LastCheckWebWork Plugin</description> <actions> <action name="com.capgemini.plugins.jira.webwork.LastCheckWebWorkAction" alias="LastCheckWebWorkAction"> </action> </actions> </webwork1>
I have a web-item and a webwork. Now I just need something to start a message like the one JIRA gives you after "Issue created".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did something go wrong with your paste of the code? It looks like you have XML and Javascript mashed together. Was this intentional?
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.