Forums

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

How to handle two web items in jira issue screen

Bhagavan Goud
Contributor
August 5, 2021

We have uploaded two web-item plugin jars in the Jira test server coming to the point two are not working at a time. 

only one web item working at a time only two are not working  

1 answer

1 accepted

0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
August 5, 2021

Hi @Bhagavan Goud can you share your atlassian-plugin.xml file(s)?

Bhagavan Goud
Contributor
August 5, 2021

<?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="BigpicturePlugin"/>
<!-- add our web resources -->
<web-resource key="BigpicturePlugin-resources" name="BigpicturePlugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="BigpicturePlugin.css" location="/css/BigpicturePlugin.css"/>
<resource type="download" name="BigpicturePlugin.js" location="/js/BigpicturePlugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>atl.general</context>
<context>jira.general</context>
<context>jira.view.issue</context>
<context>BigpicturePlugin</context>
</web-resource>
<web-item name="bigpicturePlugin" i18n-name-key="bigpicture-plugin.name" key="bigpicture-plugin" section="transitions-all" weight="1000">
<description key="bigpicture-plugin.description">The bigpicturePlugin Plugin</description>
<label key="Create BigPicture"></label>
<link linkId="bigpicture-plugin-link"/>
<tooltip key="Automatically create a new Bigpicture project with information of the displayed Jira Issue"/>
<conditions type="AND">
<condition class="com.ebmpapst.jira.BigpicturePlugin.ProjectVisibleCondition">
<param name="Project-Management">Project Management</param>
</condition>
<condition class="com.ebmpapst.jira.BigpicturePlugin.ProjectMemberVisibleCondition">
<param name="Project-members">Projectmembers</param>
</condition>
</conditions>
</web-item>
</atlassian-plugin>

Bhagavan Goud
Contributor
August 5, 2021

<?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="projectcreator"/>
<!-- add our web resources -->
<web-resource key="projectcreator-resources" name="projectcreator Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="projectcreator.css" location="/css/projectcreator.css"/>
<resource type="download" name="projectcreator.js" location="/js/projectcreator.js"/>
<resource type="download" name="images/" location="/images"/>
<context>atl.general</context>
<context>jira.general</context>
<context>jira.view.issue</context>
<context>projectcreator</context>
</web-resource>
<web-item name="jiraButton" i18n-name-key="jiraButton.name" key="jiraButton" section="operations-top-level" weight="1">
<description key="jiraButton.description">The jiraButton Plugin</description>
<label key="Create Jira Project"></label>
<link linkId="jira-button-link"/>
<tooltip key="Automatically create a new Jira project with information of the displayed Jira Issue"/>
<conditions type="AND">
<condition class="com.ebmpapst.jira.projectcreator.ProjectVisibleCondition">
<param name="Project-Management">Project Management</param>
</condition>
<condition class="com.ebmpapst.jira.projectcreator.ProjectMemberVisibleCondition">
<param name="Project-members">Projectmembers</param>
</condition>
</conditions>
</web-item>
</atlassian-plugin>

Bhagavan Goud
Contributor
August 5, 2021

I have used two different web item plugins

Bhagavan Goud
Contributor
August 5, 2021

above two web items buttons are using in one test server

but not working at a time

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
August 6, 2021

Hi @Bhagavan Goud first, I would use some generic values for "name" and "key" attributes. For example bigPicture is one App from marketplace so if you have it installed on your environment, it could cause some troubles if App from marketplace uses the same key/name values.

Second, try to simplify the web items as much as possible... remove conditions, parameters, tooltips and test it... then add more configuration items one by one.

If you install both plugins, which one is working?

Bhagavan Goud
Contributor
August 8, 2021

Hi @Martin Bayer _MoroSystems_ s_r_o__ please can you send the example code of Atlassian-pugin.xml file

Bhagavan Goud
Contributor
August 9, 2021

Screenshot (137)_LI.jpg

Bhagavan Goud
Contributor
August 9, 2021

Hi. @Martin Bayer _MoroSystems_ s_r_o__ 

We are using Two web items buttons in one jira issue for creating projects like above picture

1.JiraProject creator

2. bigPicture creator

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2021

A random example of an atlassian-plugin.xml is not going to help you.  Your plugin code needs to not duplicate keys that are used by others.

As Martin says, start by simplifying it - strip it back to a basic application as generated by the plugin sdk as an empty template, then start adding in one thing at a time until you get a clash and it stops working.

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
August 9, 2021

Thank you @Nic Brough -Adaptavist- ... to be more understandable, what I mean by simplifying the descriptor file is... for one of your descriptors (I removed everything with BigPicture, because it looks really suspicious to me :)):

<?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>
<web-item name="myCommunityPlugin" i18n-name-key="my-community-plugin.name" key="mycommunity-plugin" section="transitions-all" weight="1000">
<description key="my-community-plugin.description">My Community Plugin</description>
<label key="My Community Plugin Web Item"></label>
<link linkId="my-community-plugin-web-item-link"/>
</web-item>
</atlassian-plugin>

You can also find example here: https://developer.atlassian.com/server/jira/platform/web-item/


It is sometimes easier to try to start from the scratch, you do not need to implement all the code on he beginning, you just need to get it work in small steps... trust me, I had small typos in my descriptors few times... it is so easy to overlook something :) 

Like # people like this
Bhagavan Goud
Contributor
August 10, 2021

Hi, @Martin Bayer _MoroSystems_ s_r_o__ I understood your concern about what happened here Two buttons are working individually but together not working.

only one button working 2nd one is not working while present two buttons

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 10, 2021

Yes, you've said that.  What Martin is saying is that the two apps are clashing because of duplicate identifiers, names or possibly classes.  When this is done, Jira can only load and use one single item, it has to ignore the other.

So you need to find and fix whatever it is that is clashing.  It is most likely to be in the atlassian-plugin.xml and we're recommending that you try stripping the one in your app back to the basics so that it can't have anything in it that clashes with the other app.  

Like # people like this
Bhagavan Goud
Contributor
August 10, 2021

Hi, @Nic Brough -Adaptavist- @Martin Bayer _MoroSystems_ s_r_o__ Thank you, I will try in that way

Harshit Sharma
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!
July 29, 2024

@Bhagavan Goud 
I faced the same issue before; it was caused by having the same class name in the webwork used for two different plugins.

Suggest an answer

Log in or Sign up to answer