In this article I will show you a simple but powerful use case of how you can utilize Jira workflow transition to protect Jira issue fields content. This is another type of Jira issue security which you can introduce to your project configuration, where you will not need to introduce any customizations with a plugin.
Protect screen fields in selected status
In this use case, I want to make sure that during the entire lifecycle of a selected task type, only members of a certain role will be able to make changes. I cannot use the Jira workflow property on each status in the same way as I described in this article, because this would disable issue editing completely. My goal is to disable it only for certain project roles.
To illustrate this use case, I will use an issue ‘Requirement’
As the owner of this requirement, as soon as it is transitioned to status ‘In Progress’, I want to make sure that it will not be changed by unauthorized users i.e. users in role ‘Project Members’.
When I transition the issue to the next status ‘In Progress’, Project Members will only be able to add comments. Editing has been selectively switched off only for them. However, editing is still possible for users in role Project Manager. This scenario can be useful when, for example, a Project Manager wants to change and Epic Link and associated this Requirement issue to another Epic.
When you look at the same issue ‘Requirement’ but as Project Manager, you will see a special transition button ‘Modify Issue’ which will allow you to modify certain, selected fields.
No fields will be editable to users in the ‘Project Manager’ role unless the transition button ‘Modify issue’ is clicked.
Deciding which fields you want to put on this screen gives you an additional possibility to select which fields you want to allow to be modified. This can be an Epic Link field, Fix Version, Assignee or any other field which is present on the main issue screen.
Modify workflow and add the role-based condition
To prepare this configuration, go to Jira Administration / Workflows and find the workflow you want to modify. In the Edit mode
Create a new transition, where the source and target of this transition will be the same status. Sometimes this time of transition is called ‘loop’ or ‘looping’ transition.
Select this transition and you will need to do two modifications:
1) Create a condition that only users in a role ‘Project Manager’ can do the change. Use the condition
Save it and you will see this condition added.
2) The second modification is about adding a transition screen. Prepare a screen with only the fields you want to allow to be modified. Remember about the naming convention when you create a new screen. Then add the screen to the transition.
Now publish the workflow and test your new configuration.
Before you go…
If, for any reason, you also want to disable adding any comments when an issue is in status ‘In Progress’, you can supplement the status properties with a workflow property jira.permission.comment.denied. You can learn more here on this property can be used to disable issue editing using workflow properties.