Hide UI worklog tab

Erik Buchholz
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.
May 26, 2021

Hi,

we want to hide the work log tab from activity panel (with all, comments, work log, history and activity) in the issue view.

Screenshot-2021-05-27-worklog-tab-in-activity-panel.png

I tried to use scriptrunner hide UI fragment but I can't find the right element.

I found the elements to hide the actions to create a new work log item but not the tab with the history.

We have Jira 8.13.6 and scriptrunner 6.3.0-p5.

Is it possible to do this with scriptrunner or somehow else?

Regards
Erik

 

5 answers

2 accepted

2 votes
Answer accepted
Erik Buchholz
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.
May 27, 2021

Many thanks to @Ioana !

With your answer I found following solution:

With _show a web panel_ fragment I can use a condition with context of the project or issue and the current user. With the key I can hide the panel itself in the same way.

Screenshot_2021-05-28-hide-with-show-panel.png

condition:

jiraHelper.project.key in ["TEST"]

script:

writer.write(
"""
<style>
#worklog-tabpanel {
display: none !important;
}
#remove-work-log-tab {
display: none !important;
}
</style>
<div>
</div>
"""
)
1 vote
Answer accepted
Ioana
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.
May 27, 2021

Hi Erik,

If you want to hide the history / worklog tab in the Activity module on issue view, you could disable the plugin module as described here: https://confluence.atlassian.com/jirakb/how-to-hide-the-history-tab-in-the-issue-panel-702710334.html 

If you want to do it only for certain projects/issue types, you could use Scriptrunner.

You could use a scripted field with the code below:

return """

<style>

#changehistory-tabpanel {

display: none !important;

}

#worklog-tabpanel {

display: none !important;

}

</style>

<div>

</div>"""

Ioana
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.
May 27, 2021

@Erik Buchholz , I just saw your screenshot. The script I posted should help you hide it.

Erik Buchholz
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.
May 27, 2021

Hi @Ioana ,

thanks for your answer.

Yes we want to hide it only in one project for certain users. So I modified your code a little and it works so far, if the field is in the right context and on the view issue screen.

Little disadvantage is that the field name is in the screen.

Screenshot-2021-05-27-remove-work-log-tab-with-field.png

Do you know any disadvantages of this solution compared to the hide UI fragments regarding safety or performance?

Regards
Erik

Ioana
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.
May 27, 2021

Hi Erik,

I tried to figure out a way to achieve what you are looking for, but with no success.

I use a similar script into a scripted field, but its purpose was also to display some other information and not only to hide UI elements, so I didn't think of hiding the field from the screen.

The only option I can think of is adding the code into the Announcement banner, but that would apply the change to the entire Jira instance. 

I don't think there are any security concerns related to using this script, nor performance issues, as long as you have a context for the field so that it is not applied to all issues.

Regards,

Ioana

Like Erik Buchholz likes this
Erik Buchholz
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.
May 27, 2021

Hi @Ioana ,

many thanks for your answer! It guided me to a solution.

Regards
Erik

PS: I accepted your answer because the part with deactivation of the plugin module to do it global is right, as I didn't mention in the question that I just want to hide it under certain conditions.

Wim Abts September 23, 2021

@Ioana 

The link you gave with the explanation on how to deactivate for the whole instance, is not valid any more.

Do you have another link?

Erik Buchholz
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.
September 30, 2021

Hi @Wim Abts ,

please check out

https://confluence.atlassian.com/jirakb/how-to-hide-elements-in-jira-using-css-or-javascript-958774526.html

With the css-code from @Ioana you should be able to hide the worklog.

Regards

Like Ioana likes this
2 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2021

Hi Erik,

I don't use the Server version of Jira but see if you can edit the Permission Scheme for that Project to change the Work on Issues permissions under the Time Tracking Permissions section of the permission scheme.

If the user does not have Work on Issues permission, they should not see the work log tab. At least that's how it works in Cloud. 

Erik Buchholz
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.
May 26, 2021

Hi @John Funk ,

thanks for your reply. Unfortunately in server this seams to be different. I removed all permissions but John Doe can still see the work logs.

The problem is that the users shall log their own work but should not see the work logs of the others.

We'll probably solve this by creating an issue for every user and hide the other issues.

Regards
Erik

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2021

Is there an option for View All Work Logs in server?

If not, your work around seems like the best route. 

1 vote
serkan_sezer December 28, 2022

Hi everyone. Thank you for all the reviews and replies. i have similar need.

How can we restrict the method he mentioned by groups in jira.

For example, how can we make the worklog tab appear in the jira-developers group but not in other groups?

 


--condition--

["TEST"] içinde jiraHelper.project.key

 

--scenario--


writer.write(
"""
<style>
#worklog-tabpanel {
display: none !important;
}
#remove-work-log-tab {
display: none !important;
}
</style>
<div>
</div>
"""
)
Artem Semenov November 20, 2023

Hello!

If this issue is still relevant.
I implemented this setting through the following condition:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager
String groupName = "jira-user"
def groupManager = ComponentAccessor.getGroupManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if (groupManager.getUsersInGroup(groupName).contains(currentUser)) {
    return true
    }
0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2021

Hi @Erik Buchholz

Could you please share a print screen of which worklog tab you are trying to hide?

Thank you and Kind Regards,

Ram

Erik Buchholz
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.
May 27, 2021

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,

I added a screenshot to the question and tried to clarify that it's in activity panel.

Regards

Suggest an answer

Log in or Sign up to answer