The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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 Champions.
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

5 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 Champions.
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"
TAGS
AUG Leaders

Atlassian Community Events