How to block 'Excel (All fields)' download?

J Thomas
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 21, 2011

We are finding that users are abusing the 'Excel (All fields)' export and downloading hundreds of unnecessary fields which for large queries can slow and even crash JIRA.

We have over 1000 custom fields so depending what's in context for the filter there could be say 400 fields in the spreadsheet which will mostly not be relevant to the user. If the All fields option were removed it would force users to specify the fields they want rather than taking the easy option and then deleting the unwanted columns in Excel.

What is the best way to disable the 'Excel (All fields)' feature? Is there a flag or permission in JIRA or would we need to mess with templates?

NB some of our users are smart enough to figure out the URL so just removing the option from the list probably won't stop them!

3 answers

1 accepted

4 votes
Answer accepted
J Thomas
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 21, 2011

Thanks for pointing me in the right direction Jobin!

From your starting point above I noticed that the the first line to be commented out contained

state='enabled'

and I finally realised that the system-issueviews-plugin.xml file is a plugin configuration file ie the views are plugin modules.

Therefore the easiest way to disable the 'Excel (All fields)' issue view plugin is to go to Administration > Plugins and disable the 'Excel (All)' module in the Issue Views Plugin. This takes effect immediately and doesn't need a restart.

Jobin Kuruvilla [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 21, 2011

good point :)

2 votes
Jobin Kuruvilla [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 21, 2011

Did you try removing the corresponding search request view from system-issueviews-plugin.xml residing under WEB-INF/classes?That should remove the option, not just the list but the URL should also be gone!

You can comment out the following and restart JIRA:

<search-request-view key="searchrequest-excel-all-fields" i18n-name-key="admin.issue.views.searchrequest.plugin.excel.all" name="Excel" class="com.atlassian.jira.issue.views.SearchRequestExcelViewAllFields" state='enabled' fileExtension="xls" contentType="application/vnd.ms-excel">
<resource type="velocity" name="header" location="templates/plugins/searchrequestviews/searchrequest-excel-header.vm" />
<resource type="velocity" name="footer" location="templates/plugins/searchrequestviews/searchrequest-excel-footer.vm" />
<resource type="velocity" name="descriptionTable" location="templates/plugins/searchrequestviews/searchrequest-description-header.vm" />
<order>10</order>
</search-request-view>

0 votes
Efi Bagourdi March 19, 2013

A "dirty" solution also... edit header.jsp and add script to disable per jira group:

JS.$.get((AJS.params.baseURL +"/rest/auth/1/session"), function (data) {

userName = data.name;

// check groups

AJS.$.get((AJS.params.baseURL +"/rest/api/2/user"), {username: userName, expand: "groups"}, function (data) {

var groups = data.groups;

var groupItems = jQuery.map(groups.items, function (val, j) {return val.name});

if (AJS.$.inArray("some_group", groupItems) > -1) {

AJS.$("#allExcelFields").hide();

}

Suggest an answer

Log in or Sign up to answer