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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any update on the above ? I want to make sure even project admin should not change the project name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm here again...
Just a question, this code works for my, but I discovery another case.
Insight the project configuration the item details disappear, but going to cog icon and select projects in Jira menu its possible to edit the project name.
Have you same suggestion to don't allow users to edit project name in this part?
Thanks,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.