Use this tutorial for guidance on updating access permissions for viewing/editing fields across various statuses within the workflow.
Example.
In the 'NewBacklog' status, both Peter and Rickard can view and edit. However, in the 'Waiting for ApprovalIn Progress' status, only Rickard can edit, while both Peter and Rickard can view the information.
...
Show an example how the PF Viewers is configured to have the Automation for Jira as user.
For debug or clarity you may want to add a group or reporter, creator and assignee to the View Permission of the PF Editors and PF Viewers field to see who can view edit.
Add API
Navigate to Manage Apps
Click on Protected Fields
Click on API tab
Create an API token
...
Now we want to create an automation that sets Peter to the PF Viewer and PF Editors on Create.
Create a new Automation rule
Add When: Issue Created
Add Send web request, copy the URL from the API step above, include ?toke=token&issueKey={{issue.key}} in the URL.
Add the Body, as below but change the field ids to your custom fields.
Code Block language js [ { "fieldId":"customfield_10203", "value": ["{{reporter}}"] }, { "fieldId":"customfield_10204", "value": ["{{reporter}}", "{{assignee}}"] } ]
...
Testing this will result in an issue with a secured Salary that on the first state lets Peter edit the field.
Now create a second automation that removes Peter from the PF Editors field, since its only automation user that can do this, we have secured it to the automation engine.
Create a new Automation rule
Add When: Issue Transitioned, enter the status Backlog to In Progress
Add Send web request, copy the URL from the API step above, include ?toke=token&issueKey={{issue.key}} in the URL.
Add the Body, as below but change the field ids to your custom fields.
...
Code Block | ||
---|---|---|
| ||
[
{
"fieldId":"customfield_10204",
"value": ["{{assignee}}"]
}
] |
...
This will result in removing Peter from the PF Editors field and only keep Rickard.
Now when Peter tried to edit the field he will not be able.