J tricks - Little JIRA Tricks
  • Home
  • Plugins ↓
    • JQL Tricks Plugin
      • JQL Tricks Plugin - Cloud
        • JQLT Cloud Installation
        • JQLT Cloud Configuration
        • JQLT Cloud Usage
        • JQLT Cloud License
        • JQLT Cloud FAQ
      • JQL Tricks Plugin - DC
        • JQLT DC Installation
        • JQLT DC Configuration
        • JQLT DC Usage
          • JQLT Issue Functions
          • JQLT Subtask Functions
          • JQLT Links Functions
          • JQLT Development Functions
          • JQLT Worklog Functions
          • JQLT Project Functions
          • JQLT Component Functions
          • JQLT Version Functions
          • JQLT Group Functions
          • JQLT User Functions
          • JQLT Date Functions
        • JQLT DC License
        • JQLT DC FAQ
        • JQLT DC Known Issues
        • JQLT DC Performance
      • JQL Tricks Cloud Migration
    • Simplified Planner
      • J-Planner Installation
      • J-Planner Configuration
      • J-Planner Usage
        • Creating a plan
        • Editing a plan
        • Deleting a plan
        • Viewing a plan
        • Modifying a plan
      • J-Planner FAQ
    • Atla-Search Plugin
      • Atla-Search Installation
      • Atla-Search Configuration
      • Atla-Search Usage
      • Atla-Search License
      • Atla-Search FAQ
    • Heroku for Compass App
      • Heroku for Compass Installation
      • Heroku for Compass Configuration
      • Heroku for Compass Usage
    • Copy to subtask Plugin
    • All Plugins
  • Tutorials
  • The Book
  • Contact Us
  • Home
  • Plugins ↓
    • JQL Tricks Plugin
      • JQL Tricks Plugin - Cloud
        • JQLT Cloud Installation
        • JQLT Cloud Configuration
        • JQLT Cloud Usage
        • JQLT Cloud License
        • JQLT Cloud FAQ
      • JQL Tricks Plugin - DC
        • JQLT DC Installation
        • JQLT DC Configuration
        • JQLT DC Usage
          • JQLT Issue Functions
          • JQLT Subtask Functions
          • JQLT Links Functions
          • JQLT Development Functions
          • JQLT Worklog Functions
          • JQLT Project Functions
          • JQLT Component Functions
          • JQLT Version Functions
          • JQLT Group Functions
          • JQLT User Functions
          • JQLT Date Functions
        • JQLT DC License
        • JQLT DC FAQ
        • JQLT DC Known Issues
        • JQLT DC Performance
      • JQL Tricks Cloud Migration
    • Simplified Planner
      • J-Planner Installation
      • J-Planner Configuration
      • J-Planner Usage
        • Creating a plan
        • Editing a plan
        • Deleting a plan
        • Viewing a plan
        • Modifying a plan
      • J-Planner FAQ
    • Atla-Search Plugin
      • Atla-Search Installation
      • Atla-Search Configuration
      • Atla-Search Usage
      • Atla-Search License
      • Atla-Search FAQ
    • Heroku for Compass App
      • Heroku for Compass Installation
      • Heroku for Compass Configuration
      • Heroku for Compass Usage
    • Copy to subtask Plugin
    • All Plugins
  • Tutorials
  • The Book
  • Contact Us

Modifying Atlassian bundled plugins

5/26/2012

31 Comments

 
In the latest versions of JIRA, more and more standard functionalities are pushed into bundled plugins as opposed to the JIRA core product. No better way to showcase the plugin architecture, I must admit!

But that does make the life of high end users, who wants to modify those bundled plugins, a bit difficult.
Let me take a 'once used to be simple' scenario!

              "I want to display description before issue details in the View Issue page"

This used to be pretty easy because all you need to do was to modify the relevant jsp file and that's it!

But now, the View Issue screen rendering is done by the jira-view-issue-plugin and it is an Atlassian system plugin. Although the actual work is simple, we only need to modify the atlassian-plugin.xml, making those changes effective is not as simple as editing the jira-view-issue-plugin-xxx.jar from JIRA_Home/plugins/.bundled-plugins folder.

Reason is pretty simple. All the system plugin jar files under JIRA_Home/plugins/.bundled-plugins are overwritten by the original jar files from atlassian-bundled-plugins.zip file under JIRA_Install_Directory/atlassian-jira/WEB-INF/classes/ folder whenever JIRA is restarted.

Solution? Modify the jar files under the atlassian-bundled-plugins.zip directly! Following are the steps and these steps are applicable to modifying any atlassian bundled plugins:

  1. Extract the atlassian-bundled-plugins.zip file under atlassian-jira/WEB-INF/classes folder to a separate directory.
  2. Put your customized system plugin jar in place of the existing jar file. You can either build the customized jar file from its source or just extract the jar, modify the files and create it back.
  3. Zip all the jars back with the same name: atlassian-bundled-plugins.zip
  4. Restart JIRA. It will automatically overwrite the already existing jar in JIRA_HOME/plugins/.bundled-plugins folder.

And we are done!

Steps 1-3 can be done easily if you have a utility like 7-zip in windows. For the example we considered, all we need to do is to modify the atlassian-plugin.xml file inside the jira-view-issue-plugin-5.x.jar. The different modules on view issue page like Details module, Description module etc are web-panel plugin modules and its order can modified with the weight attribute.

By default details-module has weight 100 and descriptionmodule has weight 200. The resulting default screen in JIRA appears like the following.
Before Changes

When I performed the above steps after changing the weight of details-module to 200 and descriptionmodule to 100, the resulting view issue screen is as follows.
After Changes

Not a huge task but I have stumbled initially on why the changes are not getting effective when you modify those jars in .bundled-plugin folder directly. I'm sure someone else will come across the same issue, some day. Hope they find this post useful ;)

You won't find this one but there are a few other handful tricks in the JIRA Development book released a few months ago. Don't forget to have a look if you haven't seen it yet!
31 Comments
Matt Doar link
5/29/2012 01:59:37 pm

Yup, got bitten by this a few months ago. I took your approach, though it makes deployment of these changes that much harder. The other approach for installation I've seen used is to disable the system plugin and then the new plugin provides the modified functionality. Haven't done that myself though.

Best wishes,

~Matt

Reply
J-Tricks
5/30/2012 04:16:25 am

Yeah, for big changes, I would certainly recommend your suggestion. To disable the system plugin and put a modified version of the plugin. It would at-least be easier to install/un-install/upgrade!

In fact, that is what I did for a client when I got a patch for a Confluence plugin!

Reply
Artem
7/25/2012 03:19:47 am

Thanks a lot for the solution to modify the jar file.
It worked for me!

Reply
Srinivas
12/11/2012 10:39:50 am

I want to add custom fields to details section. Can we modify the contents of this section?

Reply
J-Tricks
12/11/2012 11:25:22 am

Yes, you will have to modify the detailsblock.vm file in the same jar file under viewissue folder.

Reply
Srinivas
1/22/2013 08:36:32 am

I modified the detailsblock.vm file and i deployed the updated zip file. I am able to see the change on the view issue page but i got the following exception on the logs.
2013-01-18 20:14:22,854 localhost-startStop-1 ERROR [plugin.osgi.factory.OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.atlassian.jira.plugin.ext.bamboo' : Unresolved constraint in bundle com.atlassian.jira.plugins.jira-bamboo-plugin [63]: Unable to resolve 63.0: missing requirement [63.0] package; (package=com.atlassian.jira.plugin.viewissue.issuelink). This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see http://confluence.atlassian.com/x/1xy6D

How can this be resolved.

J-Tricks
1/22/2013 10:16:56 am

Did you modify the plugin version or change its name?

Srinivas
1/24/2013 11:40:51 am

Sorry for replying late to your latest update since i did not get a mail about your comment.
I have not modified any other files. I modified the detailsblock.vm file and created jar using the command
jar -cvf jira-view-issue-plugin-5.2.2.jar *

Wolle
4/16/2013 02:02:34 am

Use
jar -cMf jira-view-issue-plugin-5.2.2.jar *
to recreate the jar.

Reply
Joey link
5/10/2013 07:24:36 am

Thank you so much, this is just the info I was looking for!

Reply
Paul
5/23/2013 12:28:36 pm

Thank you for the info. I have looked at the xml and am frankly speaking a little confused. I can read it but there is no way I can make any changes to it. In my particular situation, I need to add some custom fields to the view. How do I do it? Can you please give me some pointers?

Thank you so much

Reply
J-Tricks
5/26/2013 04:15:37 pm

Custom fields are already in the view right? What do you mean by adding them?

If you meant adding custom fields to the "View" screen, that is done by configurations - Screen schemes to be precise.

Reply
Sachin
9/10/2013 07:07:24 pm

Hello;
I want to hide jira's time tracking panel and display my created time tracking panel instead of that. so is there any way to hide existing time tracking panel programmatically.so i can upload my plugin and hide the existing panel and show mine

Reply
J-Tricks
9/11/2013 03:41:19 pm

You should be able to do this by disabling the "timetrackingmodule" from " View Issue Panels" plugin under System plugins. You can do this via UPM and don't need modifying any plugin.

Reply
Jayashree
1/23/2014 09:26:24 pm

Followed the same steps still not able to change the atlassian bundled plugin.
Followed the steps as below.
1) I have JIRA standalone installed - D:\JIRA\amps-standalone\target\jira\webapp\WEB-INF\classes.
2)Unzip atlassian-bundled-plugins
3)Unzip jira-view-issue-plugin-6.1.6.jar . Did the change as below for details and description.
4) created jar for the changed jira-view-issue-plugin-6.1.6 from eclipse IDE. Added it into unzipped atlassian-bundled-plugins folder.
5) Zipped it again and dropped the zip file in th same location as given in (1).
6) Re-run command atlas-run
but still i am not able to see the changes done.

Reply
J-Tricks
1/23/2014 11:40:18 pm

Hi,

I haven't done on AMPS JIRA directory, only on standalone JIRA. Maybe there is a cache folder in here which needs to be cleared. Did you check that?

Reply
peepoy
2/19/2014 06:00:41 am

Hi! i need to display dates in issue discription, can i make it with this trick?

Reply
J-Tricks
3/6/2014 03:45:35 pm

Well, you can certainly hack the velocity templates to do that! But I am not sure whether displaying dates in the description is a good idea.

Reply
Matt Doar
3/7/2014 04:24:13 am

I agree with Jobin. Using one field for more than one piece of data is often a bad idea long-term. Keep the data in separate fields and if you really need a field to show a combination of fields, then use a Script Runner calculated (read-only) field.

As soon as you merge data into a field, someone will ask you to extract it and that's quite a bit harder!

Raj
7/29/2014 11:08:58 am

Hi Jobin

I want to show custom field in Issue links columns like target release and assignee and other fields

I am running jira 6.2 on windows server

I opened jira-view-issue-plugin-xxx.jar from JIRA_Home/plugins/.bundled-plugins folder, there are multiple files inside that, which file should i edit to add columns?

I dont see atlassian-bundled-plugins.zip file under JIRA_Install_Directory/atlassian-jira/WEB-INF/classes/ folder in windows installation.

thanks for your help.
Raj

Reply
J-Tricks
7/29/2014 03:49:59 pm

Unfortunately, I don't have a Windows machine to test. I see the file in the linux version though. Maybe it is a hidden file?

Reply
Raj
8/8/2014 10:33:00 am

Jobin
i found the bundled plugin zip file, which file to edit to show custom field and assignee on linked issues columns?

thanks

Terry
9/18/2014 09:56:55 am

Hi Jobin,

I am trying to share domain objects between plugins projects. I have a multi-value custom field plugin that renders to domain object: Part, and I have a workflow condition plugin that tests for the existence of a part object. I put the domain object a sharedDomain.jar and added it to the systems bundle zip, I also referenced it in the pom files with scope provided. The the custom field references the Part object just fine, but the workflow condition silently throws a NoClassDefFoundError. com/my/domain/Part

Do you have any ideas? Is there a better way to share domain objects? I have tried other methods, but have had no luck.

Thx for you help.

Reply
J-Tricks
9/20/2014 02:08:32 am

Persist the data in DB using Active Objects and refer to that. That is the recommended approach.

Reply
Terry
11/18/2014 07:51:40 am

Thx. Actually I exported it from a different plugin, and imported it in the others. This works, although it can be a bit flaky, which is why I liked just having the shared jar in one central location.

Sridhar
11/12/2014 10:17:42 pm

Hi,
I added a web panel to the atlassian-plugin.xml in jira-view-issue-plugin.XXX.jar for JIRA 6.0,8
When deployed, I could see the web panel, but my issuelink functionality is failing, the following error during startup..

2014-11-13 07:54:37,143 FelixDispatchQueue ERROR [osgi.container.felix.FelixOsgiContainerManager] Framework error in bundle com.pyxis.greenhopper.jira
org.osgi.framework.BundleException: Unresolved constraint in bundle com.pyxis.greenhopper.jira [157]: Unable to resolve 157.0: missing requirement [157.0] package; (package=com.atlassian.jira.plugin.viewissue.issuelink)
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1584)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
at com.atlassian.plugin.osgi.util.BundleClassLoaderAccessor$BundleClassLoader.findClass(BundleClassLoaderAccessor.java:69)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.atlassian.jira.plugin.DefaultComponentClassManager.constructEvenIfNotEnabled(DefaultComponentClassManager.java:133)
at com.atlassian.jira.plugin.DefaultComponentClassManager.newInstance(DefaultComponentClassManager.java:70)
at com.atlassian.jira.event.ListenerFactory.getListener(ListenerFactory.java:31)
at com.atlassian.jira.event.DefaultListenerManager$Listeners.loadListeners(DefaultListenerManager.java:162)
at com.atlassian.jira.event.DefaultListenerManager$Listeners.create(DefaultListenerManager.java:104)
at com.atlassian.jira.event.DefaultListenerManager$Listeners.create(DefaultListenerManager.java:99)
at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:140)
at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:87)
at com.atlassian.jira.event.DefaultListenerManager$Listeners.start(DefaultListenerManager.java:126)
at com.atlassian.jira.event.DefaultListenerManager.start(DefaultListenerManager.java:47)
at com.atlassian.jira.ComponentManager.runStartable(ComponentManager.java:290)
at com.atlassian.jira.ComponentManager.startJIRA(ComponentManager.java:237)
at com.atlassian.jira.ComponentManager.quickStart(ComponentManager.java:212)
at com.atlassian.jira.ComponentManager.start(ComponentManager.java:197)
at com.atlassian.jira.upgrade.PluginSystemLauncher.start(PluginSystemLauncher.java:23)
at com.atlassian.jira.startup.DefaultJiraLauncher$3.run(DefaultJiraLauncher.java:115)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:315)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:209)
at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:105)
at com.atlassian.jira.startup.DefaultJiraLauncher.access$100(DefaultJiraLauncher.java:30)
at com.atlassian.jira.startup.DefaultJiraLauncher$1.run(DefaultJiraLauncher.java:69)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:33)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:64)
at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:54)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Reply
J-Tricks
11/18/2014 01:56:38 am

It is not recommended to use this method to add a web-panel. Why don't you add it in a plugin? See https://developer.atlassian.com/display/JIRADEV/Web+Panel+Plugin+Module

Reply
manuel
7/22/2015 08:40:20 am

I would like to something similar to this:

"I want to display description before issue details in the View Issue page"

I'm using the OnDemand Jira product. I don't see how i can access the system plugins.

Any suggestions appriciated!

Reply
J-Tricks
7/22/2015 10:21:38 am

Unfortunately, it is not an option in onDemand JIRA.

Reply
manuel
7/22/2015 01:38:53 pm

Ok, thank you for quick response!

Pan921
11/10/2016 04:05:44 am

Hi Jobin,
I want always to show the last 20 comments in the Activity panel in Jira. I set up property - jira.comment.collapsing.minimum.hidden = 20, but it doesn't work.
after reaching 20 reviews, they are turned off , and again shows only 5 comments.
Do you have any ideas, what I need to do?

Reply

Your comment will be posted after it is approved.


Leave a Reply.

    Enter your email address:

    Author

    Jobin Kuruvilla - Works in Adaptavist as Head of DevOps Professional Services. 

    Author of JIRA Development Cookbook and JIRA 5.x Development Cookbook.


    RSS Feed

    Categories

    All
    Acive Objects
    Ajs
    Book
    Components
    Condition
    Custom Fields
    Customization
    Events
    Gadgets
    Javascript
    Jql
    Listener
    Mail
    Permissions
    Plugin Framework
    Post Function
    Properties
    Remote Invocation
    Reporting
    Rest
    Scheduled Tasks
    Search
    Services
    Soap
    Summit
    User Interface
    Validator
    Webwork Actions
    Workflow

    Archives

    October 2016
    August 2016
    March 2016
    January 2016
    December 2015
    May 2014
    December 2013
    November 2013
    July 2013
    June 2013
    April 2013
    October 2012
    September 2012
    August 2012
    July 2012
    May 2012
    March 2012
    February 2012
    January 2012
    December 2011
    November 2011
    June 2011
    May 2011
    April 2011
    March 2011
    February 2011
    January 2011
    November 2010
    October 2010
    September 2010
    August 2010

SUPPORT
APPS
TUTORIALS
THE BOOK
© J-Tricks