JIRA pluggin Development - Show alert/notification -


i developing jira plugin of type workflow post function.

this means dont have use vm file (velocity template).

i have java class extends abstractjirafunctionprovider. calls web service (asynchronously) using soap update remote system on status of jira issue.

i have got working , configured triggered when jira status transitions done. trying show message notify user if web service has been called or not. how show popup message text. tried joptionpane.showmessagedialog(null,"text","text 2") plugin class doesn't seem plugin java class extends abstractjirafunctionprovider. thoughts or ideas me try?

i had a similar question didn't satisfactory answer far. further research lead me different direction (to log log file , let jira admin deal it). but, can try workflow plugin module can use purpose: a validator module. code triggered right after user submits transition dialog, prior transition accepted (it's used validate if input parameters in dialog valid current transition). so, might take approach of using validator check if service , throw exception if it's not. way, of course, preventing normal workflow in jira, if remote service not available.

another solution (which might find more convenient case) extend jira view action adding webwork module. first, add new webwork module in atlassian-plugin.xml file:

<webwork1 key="view-issue" name="view issue warnings" class="java.lang.object">     <description>view issue warnings</description>     <actions>         <action name="com.my.jira.plugin.blah.blah.extendedviewissue" alias="viewissue">             <view name="success">/secure/views/issue/extended-viewissue.jsp</view>             <view name="issuenotfound">/secure/views/issuenotfound.jsp</view>             <view name="permissionviolation">/secure/views/permissionviolation.jsp</view>             <command name="moveissuelink" alias="moveissuelink">                 <view name="error">/secure/views/issue/viewissue.jsp</view>             </command>         </action>     </actions> </webwork1> 

then, override class viewissue extendedviewissue (see above) , add public method check if service available , method invoked jsp page displays issue:

public boolean isserviceavailable() {     // todo code checks if service available     return false; } 

edit file extended-viewissue.jsp , add div contain warning if condition satisfied.

<ww:if test="/isserviceavailable() == false">     <div class="aui-message warning">         <span class="aui-icon icon-warning">the service not available!</span>     </div> </ww:if> 

it should if done properly: screenshot

keep in mind after each jira upgrade you'll have again edit jsp file, because changes introduced there might lost during upgrade.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -