How to hide "Create Project" menu item with Fragments?

WilliamR May 9, 2023

I need to have the "Create Projects" menu item visible to only a specific group.

  • Using Hide system or plugin UI element
  • Can locate the element via fragment locator and add to Hide what:
    com.onresolve.jira.groovy.groovyrunner:sr-generated-browse_link/project_new
  • I disable fragment locator and the element disappears from Hide what and I can't find it anymore
  • Enable fragment locator and it's back
  • Menu item is never hidden

What's going on?

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Peter-Dave Sheehan
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 9, 2023

When you enabled fragment locator, scriptrunner generates a bunch of fragments for all the various locations where new web-items could be insrted.

So what you've attempted to hide is one of those dynamically generated fragment.

Web-items can't be identified with the fragment locator. Only sections and panels.

What you want to hide are these two:

  • jira.webfragments.browse.project.links:create_project > hides the button on the "view all projects page"
  • com.atlassian.jira.project-templates-plugin:project_template_create_link > hides the menu item "create project" in the Projects menu

There is no easy way to identify a web item's key even using the fragment locator. 
You just have to filter with something useful (like create or project) and scan through the list and try likely candidates until you find the one you like/want.

WilliamR May 11, 2023

That did it, thank you

TAGS
AUG Leaders

Atlassian Community Events