How to hide the activity, worklog and other tabs in the issue view screen?
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In this article, we will understand how we can hide a few of the elements present on the issue view screen. For example, Activity, History, workflow tabs, etc. Sometimes, there is a requirement to hide all the other tabs except the comment tab and this article will help for such scenarios.
Solution
There are two ways to achieve this.
First Way
- One way to disable the Worklog, history, All tabs from the issue view screen is to disable the corresponding modules of the system plugin Issue Tab Panels Plugin. User would need to navigate to Jira administration > Manage Apps and search for the plugin. Screenshot below for reference.
- For example, in the above screenshot, the History and All tabs panels are disabled and hence these two tabs won't be visible in the issue view screen.
- If the user also needs to disable the Activity tab, then the user would need to find the system plugin under the Manage apps with the name: JIRA Activity Stream Plugin and disable the module with name Activity Stream Issue Tab Panel. Disabling this module will also remove the Activity tab from the issue view screen.
Note: Please note that since we are disabling the system modules from the system plugin, the change will reflect on all the Jira issues present on the Jira instance. Also, since this lies under customization, Atlassian do not recommend or support these changes. Please implement after thorough testing in some lower environments.
Second Way
The demerit of the above approach is that it will implement the change for all the Jira issues but sometimes the requirement may be such that this needs to be done specifically for particular project and not all the projects. In such case, we can make use of third-party plugin ScriptRunner and can use the Fragments functionality available with it to hide the UI tabs.
- Create a scriptrunner fragment by navigating to the Jira administration > ScriptRunner > Fragments.
- Provide any name and select the location as: atl.jira.view.issue.left.context , put a key name as let-only-comment-tab. Put weight as 9999.
- Provide Condition as jiraHelper.project?.key == "KANBAN". You can change the project key based on your need. Here we have used KANBAN.
Provider class/script as below:
writer.write( """ <style> #worklog-tabpanel { display: none !important; } #all-tabpanel { display: none !important; } #changehistory-tabpanel { display: none !important; } #activity-stream-issue-tab { display: none !important; } #activity-tabpanel { display: none !important; } #let-only-comment-tab { display: none !important; } </style> <div> </div> """ )
- Save it and it will hide all the elements present in the script.
Please note that customizations lie outside of Atlassian Support purview and the approach suggested in the article is not the Atlassian recommended nor Atlassian supports it. Instead, it focuses on achieving the use case. Please perform thorough testing before implementing it in your Jira instance.