Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,294
Community Members
 
Community Events
184
Community Groups

I need to display a custom dialog in response to both a web item and a webWork.

Gaddam Kavitha
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!
May 02, 2023

Below is my code which I am trying to display the dialog but it is rendering on same page. I need it as dialog. I don't no where i am wrong as i am very new to atlassian jira.Please can any one help.

 

1) myPlugin.js :

 

(function ($) {
new AJS.FormPopup({
id: "dg-issue-dialog",
trigger: ".issue-baseline-issue"
});
})(AJS.$ || jQuery);
2)input.vm :
<form class="aui" action="BaselineWebworkModuleAction.jspa" method="post">


<div class="hidden">
<input name="atl_token" type="hidden" value="${atl_token}">
</div>
<h2 class="dialog-title">Custom Dialog</h2>
<div class="hidden">
<input name="id" type="hidden" value="${action.id}">
<input name="returnUrl" type="hidden" value="$!{action.returnUrl}">
</div>

<div class="buttons">
<input class="button" type="submit" value="Cancel" />
</div>
</form>
3)BaselineWebworkModuleAction.java
package com.atlassian.tutorial.myPlugin.impl;

import com.atlassian.jira.security.xsrf.RequiresXsrfCheck;
import com.atlassian.jira.web.action.JiraWebActionSupport;


public class BaselineWebworkModuleAction extends JiraWebActionSupport
{

public BaselineWebworkModuleAction() {

}

protected void doValidation()
{
}

@RequiresXsrfCheck
protected String doExecute() throws Exception
{
return returnComplete("/");

}

public String doDefault() throws Exception
{
return INPUT;
}



}
atlassian-plugin.xml
<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
<description>${project.description}</description>
<version>${project.version}</version>
<vendor name="${project.organization.name}" url="${project.organization.url}"/>
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>
</plugin-info>
<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="myPlugin"/>
<!-- add our web resources -->
<web-resource key="myPlugin-resources" name="myPlugin Web Resources">
<!--<dependency>com.atlassian.auiplugin:ajs</dependency> -->
<transformation extension="js">
<transformer key="jsI18n"/>
</transformation>
<!--<resource type="velocity" name="input" location="/src/main/resources/templates/input.vm"/>-->
<resource type="download" name="myPlugin.css" location="/css/myPlugin.css"/>
<resource type="download" name="myPlugin.js" location="/js/myPlugin.js">
<property key="content-type" value="text/javascript"/>
</resource>
<resource type="download" name="images/" location="/images"/>
<context>atl.general</context>
</web-resource>

<web-section name="mySection" i18n-name-key="my-section.name" key="my-section" location="my-item-link" weight="1000">
<description key="my-section.description">The mySection Plugin</description>
<label key="my-section.label"/>
</web-section>

<web-item name="myItem" i18n-name-key="my-item.name" key="my-item" section="system.top.navigation.bar" weight="1000">
<description key="my-item.description">The myItem Plugin</description>
<label key="my-item.label"/>
<link linkId="my-item-link">deleteMe</link>
</web-item>

<web-item name="Atlassian Developers Site" i18n-name-key="atlassian-developers-site.name" key="atlassian-developers-site" section="my-item-link/my-section" weight="1000">
<description key="atlassian-developers-site.description">The Atlassian Developers Site Plugin</description>
<label key="atlassian-developers-site.label"></label>
<link linkId="demo-dialog">/secure/BaselineWebworkModuleAction!default.jspa?id=${issue.key}</link>
</web-item>


<webwork1 key="baseline-webwork-module" name="Baseline Webwork Module" i18n-name-key="baseline-webwork-module.name">
<!--<description key="baseline-webwork-module.description">The Baseline Webwork Module Plugin</description>-->
<actions>
<action name="com.atlassian.tutorial.myPlugin.impl.BaselineWebworkModuleAction" alias="BaselineWebworkModuleAction">
<view name="input">/templates/input.vm</view>
</action>
</actions>
</webwork1>
</atlassian-plugin>

1 answer

0 votes
Gaddam Kavitha
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!
May 02, 2023

Please can any one suggest where i am doing wrong

Suggest an answer

Log in or Sign up to answer