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

Nicolas Simon
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.
September 20, 2017

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
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.
September 21, 2017

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

Nicolas Simon
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.
September 21, 2017

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

josh
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.
September 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