Hi everyone,
I have two quick about hiding elements/pages from a user in Jira Service Desk.
Is it possible to hide a certain page inside a project from a specific user with ScriptRunner?
I would like to hide the page /customers in a service desk for a specific service desk agent.
I know there's a built-in script that can hide the menu icon for customers.
Is it possible to do on a user-level, so that only a particular user in a project doesn't see that menu icon?
Thanks a lot in advance :)
Jira server: 8.13.1
Jira service desk: 4.13.1
Hi Silas,
In the condition code of the built-in script, you can check which user is logged in with the JiraAuthenticationContext:
def user = ComponentAccessor.jiraAuthenticationContext?.loggedInUser
and use that to decide whether to show or hide the icon.
Joanna Choules
Adaptavist Product Support
Thank you!
Do you know if it would be possible to hide the content on a certain URL altogether using the same check?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The script isn't built for hiding entire pages, but if you can identify the UI elements containing the content you don't want to be shown (the fragment locator might help with this), then you can hide those as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes indeed.
I realized yesterday in the evening, that I simply need to hide whatever I need in the same way.
I'm having some trouble locating the id for the section I need to hide. The "Hide UI Element" script only takes Ids that start with com.atlassian something, but the section I would like to hide doesn't have a com.atlassian Id, just an id like this: div.js-page-panel-content.sd-page-panel-content
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you find this ID? It looks like it might be a CSS selector, but Jira uses its own naming system for UI components.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joanna.
It's the ID I'm getting for the web section showing the customers list in a service desk project. I find it by highlighting it in developer mode:
The problem I'm facing is that I'm trying to hide the customer list here, but it doesn't have a unique ID from what I can tell, because it's not a web element, but a web section.
From what I understand, I'll have to create a .js script to hide this, but I'm not sure how to set this up for a specific user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silas,
Thanks for clarifying. In Javascript, you can determine which user is logged in as follows:
JIRA.Users.LoggedInUser.userName()
and use that to decide whether to hide the element.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.