Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,856
Community Members
 
Community Events
184
Community Groups

Is it possible to hide a page/section from a user in Jira Service Desk with ScriptRunner

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

1 answer

1 accepted

0 votes
Answer accepted
Joanna Choules
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.
Jan 11, 2021

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?

Joanna Choules
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.
Jan 11, 2021

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.

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

Joanna Choules
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.
Jan 20, 2021

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.

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:

web section question.png

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. 

Joanna Choules
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.
Feb 03, 2021

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events