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:
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. 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. 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
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.
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!
Reply
Artem
7/25/2012 03:19:47 am
Thanks a lot for the solution to modify the jar file.
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.
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.
Wolle
4/16/2013 02:02:34 am
Use
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?
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?
Reply
Sachin
9/10/2013 07:07:24 pm
Hello;
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.
Reply
J-Tricks
1/23/2014 11:40:18 pm
Hi,
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.
Raj
7/29/2014 11:08:58 am
Hi Jobin
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
Terry
9/18/2014 09:56:55 am
Hi Jobin,
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,
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:
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,
Reply
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorJobin Kuruvilla - Works in Adaptavist as Head of DevOps Professional Services. Categories
All
Archives
October 2016
|