Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner, UI fragment, hide the Share button from the customer portal/ request view.

Antoine _Klee Group_
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.
March 20, 2025

Hi,

As you may know, we HAVE to enable full share access in the customer permission in order for customers to be able to select a user in a user picker field, even if this is not related to sharing the issue at all. The "browse users and roles" global permission is not sufficient.

Anyway, this (and you won't believe me) enables the customer to share his request to anybody within the project (👁️👄👁️), a behaviour I do not want.

I therefore wish to hide the "share" button available on the portal view/customer's request view. My instance does have Adaptavist Scriptrunner and I believe UI fragments can do the job.

My issue is that I do not find which system fragment to use.

When I enable the "fragment locator", it does display those items on the portal

image.png

But I do not find any of those in this list:

image.png

(and unfortunately, both items I selected do not change anything)

 

Can anybody help?

Bonus question: How to write the condition so that the fragment is only active on this single project only?

Thanks.

 

1 answer

1 accepted

3 votes
Answer accepted
Antoine _Klee Group_
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.
March 25, 2025

As answered per Adaptavist support, here's a quick procedure:

  1. Select "Custom Web Panel" UI Fragment.
  2. Location is:
    request-options
  3. key is random
  4. The script is:
    writer.write("""

    <style>

    #cp-request-share-root > div > div:nth-child(2){

    display : none;

    }

    """)

    With the location being selected with the "inspect webpage and copy selector" on the specific "share" button element.
  5. Eventually and if needed, a condition so that the script loads only on specific portals, I did it based on the project key:
    issue.projectObject.getKey() == "IN"

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community, journeys for jira service management, journeys for jsm, eap jsm atlassian, early access program atlassian, early access program journeys atlassian, early access program journeys jira service management, join atlassian eap

Join the Early Access Program (EAP) - Journeys for Jira Service Management 🚪

Journeys is a brand new feature in Jira Service Management that helps you streamline various processes in your organization that may cross multiple departments, such as employee onboarding or off-boarding that require action from different teams. ✨

Join the EAP →
AUG Leaders

Atlassian Community Events