Possibility to provide editable rights on certain Custom Field based on users/group

Manu Mishra April 4, 2019

Hello,

I am looking for a possibility to provide editable rights on one custom field {Sprint} for only one user/group while editing issues on one project. Any groovy script/behavior would be helpful since we have Script Runner plugin in our instance.

What I Needed: 

  • We have two project role {Administrator, Watcher} in the project.
  • In the project permission scheme we have NOT given "Edit Issue" permission to Watcher role, however we only want "Sprint" field to be able to Edited by role Watcher.

JIRA Version: 7.4.4

Script Runner: 5.1.0

 

Regards,

Manu

1 answer

2 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2019

Scriptrunner/behaviour can't GRANT permission if it's denied by the permission scheme. The users' can't even open the edit screen (or do inline edits).

You would have to open up the permission in the permission scheme to allow Edit Issue for watchers, then use behavior to set ALL OTHER fields to read-only.

This means of course, that your watchers (if they are technical) would be able to change ANY fields via REST API since those are not intercepted by Behaviour.

The only way the scriptrunner can allow edits to a certain field would be to bypass the edit screen altogether. You could do that with a custom rest api or perhaps a custom script listener.

Perhaps a simpler solution is to leverage the workflow (no scriptrunner involvement). 

Create a global transition (from any state to any state) called "Update Sprint". Provide a screen with only the sprint field, and open up the conditions to allow watchers to execute it.

Suggest an answer

Log in or Sign up to answer