Attempt to hide the "Create with shared configuration" link in the Create project dialog

Hello All,

My final purpose is to hide the "Create with shared configuration" link in the Create project dialog for non sys admin users.

So I started working with some Javascript in the Jira banner to solve this problem as it seemed appropriate, I managed to figure out how to check whether the current user is in some group with the help of this thread -> https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-get-groups-for-current-login-user-via-Rest-javascript-in/qaq-p/524586

So now the thing is to hide the link. I found out that HTML class of that link is "create-with-shared-config" so I thought that the following code would do the job:

document.getElementsByClassName('create-with-shared-config')[0].style.display = "none";

 But it does not work and it was actually expected. When the page is loaded, the Javascript is executed but no object of class "create-with-shared-config" exist. It is only displayed when the user clicks on the "Create project" link, but at this point the Javascript is not re-executed and the link eventually appears.

So I am kind of stuck now. I was trying to find if an HTML event was thrown when the user clicks on the "Create project" link and trigger a listener at that time that would actually execute the Javascript.

Did any of you run into such issue in the past ? Have you got some hints or idea that would help me achieve my goal ?

Thanks a lot

1 answer

0 votes
Josh Steckler Community Champion Sep 21, 2017

Curious - what problem are you trying to solve by removing this link?

This is the requirement from the operation team. Also, I am interested in the technical challenge.

Josh Steckler Community Champion Sep 21, 2017

You're ok with them creating projects off of the example templates? It's interesting to me because I hear the opposite a lot. Disable the example templates and only allow shared configuration.

Sorry I'm no help finding a cool technical solution :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

23,677 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you