Hi all,
I tried to limit field edtiting for a particular field except for two or more workflow steps with different projectroles or groups. I tried this with ScriptRunner Plugin. But it seems that complex conditions are not possible with this plugin - or maybe i missed something. To show the goal, here is an example in pseudocode:
field = getFieldByName("CodeTags")
if (currentUser.isInProjectRole("Developer")
and issue.isInWorkflowStep("in Development")
or currentUser.isInGroup("ConfigurationManager")
and issue.isInWorkflowStep("create Build")) {
field.setEditingDisabled(false)
} else {
field.setEditingDisabled(true)
}
Hint: It is not an option to disable editing in the most of our workflow steps and use only transitions for editing.
Has anyone an idea or a hint to an other plugin which helps to reach the goal?
Thank you.
Mark
I found the solution for my Problem: The role and group permissions are checked via workflow step properties:
jira.permission.edit.projectrole.1=10013
on one workflow step (you have to use the internal id and not the role name!) and
jira.permission.edit.group.1=ConfigurationManager
on the other one. So editing is restricted to the group or the defined role in both workflow steps. Since these group and project role are assigned to other workflow steps as well and editing should only happen on these two steps: The behaviour from ScriptRunner for JIRA will solve the problem:
In the behaviour I only reduce the editing permissions to the workflow steps. No need to define the project role or group in the behaviour
You can use Behaviours that is part of Scriptrunner to do this, that is what I use to limit who can edit certain fields based on project role and status/transition. See Field-level Permissions for more information.
Here is an example of one of my restricted fields:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats the way I tried to use the plugin. But that only works if you have exact one workflow step and one project role or group. But if you have more than one step you cannot define an or clause for the other combination of role and step :-(
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.