Forums

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

Display input dialog box in jira

Mamikon Papikyan
Contributor
October 2, 2020

Hi atlassian,

I have atlassian java listener plugin. I want to show input dialog box for during the issue event, such as <input type="text" > html tag. Is there a solution to do that? 
For Note: I used JFrame for java, but it didn't work.

Sorry for bad English :)

Thanks,

Mamikon

1 answer

1 accepted

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
October 2, 2020

hi @Mamikon Papikyan you can't do it by default. You would have to implement some mechanism which "listens" to event caused by listener. I will try to describe. There are two processes

  • Process 1: issue is updated (Issue event fired) ->  Issue updated listener is executed -> it will prepare result somewhere
  • Process 2: there is JavaScript code in frontend part of the application -> it checks whether there are some data prepared or not on backend. If there is some result, JavaScript displays dialog.

Problem of this solution is performance. If you will invoke JS(JavaScript) action to often (once a  second), it is 60 invocations in one minute for one tab of browser. If you have 500 users with 3 tabs opened, it is 1500*60 invocations per minute.

By the way, JFrame is Java SE technologi, you can't use it on web.

Mamikon Papikyan
Contributor
October 7, 2020

Thank you for your answer Martin.  Sorry for late answer, but actually I want to get data from velocity. I have a listener plugin written java, So I be able to show dialog box using javascript in .vm file. 

Here my velocity

#set ( $d = "$")
<script language="JavaScript">
AJS.${d}(document).ready(() => {
AJS.${d}('#cus-butt').click(() => {


var username = document.getElementById("username").value;
var password = document.getElementById("password").value;

</script>


<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username"><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"><br>
<input type="submit" value="Login" id="cus-butt">
</form>

Now I want to send username and password value in my java listener . Let me to show you my atlassian-plugin.xml.

<atlassian-plugin key="${project.artifactId}" name="${project.name}" plugins-version="2">
...
<web-panel key="test25" name="test25" location="com.atlassian.jira.plugin.headernav.left.context">
<label key="Custom Issue Panel"/>
<resource name="view" type="velocity" location="button.vm"/>
</web-panel>
...
</atlassian-plugin>

Suggest an answer

Log in or Sign up to answer