Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Disable Project name editing

Hello,

I would like to prevent users from changing the project's Name, the same way they can't edit the project Key.

I noticed the project Key has 'disabled' in the HTML:

<input class="text" type="text" name="key" id="project-edit-key" value="JISJECP" maxlength="20" disabled="">

So, it is greyed out and can't be edited.

I would like to achieve the same for Name. I was thinking about using ScriptRunner to achieve it, the same way I used it to change the width of custom fields. However, the project name doesn't have any id:

<input class="text" maxlength="100" name="name" type="text" value="Project name (23248)"

Could someone give me hint on how to achieve it, please? 

If the above won't work, would it be possible to use ScriptRunner Script Fragments to 'hide' the Name field completely?

Thanks!

1 answer

1 accepted

2 votes
Answer accepted
Tanya Gordon Community Leader Aug 06, 2019

Hi,

First, the easiest way to do this is to disable the project administer permission. Users that don't have this permission can't reach the project details page and of course, can't change the project name. 

If this is not acceptable, I would try using the announcement banner to deliver the code snippet that will disable the project name for editing.

Regarding ScriptRunner Script Fragments, I don't think it's applicable for the project details screen, unfortunately.

Regards,
Tanya

Thank you, Tanya! I will try using the announcement banner.

Just to note here, in the end, I used the Script Fragments:

Hide what:

jira.webragments.view.project.operations:edit_project

Condition:

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.security.groups.GroupManager
import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

if (groupManager.isUserInGroup(currentUser, "jira-admin")) {
true
} else {
false
}

 It hid Details, Re-index and Delete project, which is even better :)

Any update on the above ? I want to make sure even project admin should not change the project name.

Hi @apuskarcik 

I used your code and works very well to me.

I just change import com.atlassian.jira.ComponentManager to  import com.atlassian.jira.component.pico.ComponentManager

And invert the if condition to meet my condition and worked very well.

 

Thanks,

Fabio

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you