Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set field as Visible & ReadOnly based on User Group & Workflow Status

Digvijay Singh
Contributor
March 25, 2025

Hi Community, 

I want to set custom fields as Visible/ ReadOnly present on particular Field tab based on user group when the issue reaches to a particular workflow status. 

For example: I have

  • User Groups: Group 1; Group 2
  • Workflow statuses: Open > In progress > Done
  • Field tabs: Tab A; Tab B
  • Custom fields: Field X (on Tab A) ; Field Y (on Tab B) 
  1. When a User (from Group 1) creates an issue and it lands on Open status, then Field X (on Tab A) should be Visible and Editable. 
  2. And Field Y (on Tab B) should be Visible and ReadOnly for User from Group 1.
  3. On the same status, User from Group 2 should see Field X (on Tab A) as Visible but ReadOnly and Field Y (on Tab B) as Visible and Editable. 
  4. If issue moves from Open to Inprogress, both users from Group 1 & 2, should see both Fields X & Y are Visible but set as ReadOnly on both Tabs A & B. 

Please guide on how to configure the above scenario in scriptrunner for jira cloud and related script code for reference. 

Thanks

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Champion
March 27, 2025

Hi Digvijay

To achieve these requirements, you would need to configure your behaviour to work on the Issue View for the On Load action.

Your script would need to stary of by getting the current status of the issue which you will need to do by making a call to the makeRequest api to get the current issue and to get the value out of the status field. 

We have an example of getting fields from the issue here that you can as a reference.

Once you have got the status, you can then write the logic to make the fields required based on a user group on the tabs, and the script examples below will help with creating this logic.

* Access tabs in behaviours example

* Make fields read only based on user group

* Make field visible/ hidden example

I do not have examples of complete scripts to achieve your requirements, but you can use the suggestions above to help build scripts to achieve your requirements. If you need further assistance with these, you should raise a ticket with our support team so they advise further.

I hope this information helps

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer