Hi Community,
Pre-requisites:
- I have three tabs on Issue View screen.
- On each tab, there are two custom fields (Total 6)
- When issue is in Open status, only first tab is visible to user.
- When issue is in In Progress, only second tab is visible to user.
- When issue is in Done, all three tabs are visible to user.

Requirement:
- When user (from specific group) transitions the issue from Open to Cancelled (Transition ID 1), then on Cancelled status, only first tab's fields should be Visible and in ReadOnly mode - other tabs (tab 2 & tab 3) should be hidden.
- When user (from specific group) transitions the issue from In Progress to Cancelled (Transition ID 2), then on Cancelled status, only second tab's fields should be Visible and in ReadOnly mode - other tabs (tab 1 & tab 3) should be hidden.
- When user (from specific group) transitions the issue from Done to Cancelled (Transition ID 3), then on Cancelled status, all the three tab's fields should be Visible and in ReadOnly mode.
I referred to this scriptrunner behavior example:
https://www.scriptrunnerhq.com/help/example-scripts/make-fields-required-on-transition-for-user-groups-cloud
https://www.scriptrunnerhq.com/help/example-scripts/Make-field-read-only-based-on-user-groups-cloud
But I'm not getting any success as user from specific group is still able to edit the field on Cancelled. Fields should be editable only on other statuses instead of Cancelled.
Please guide on how to set fields ReadOnly on Cancelled by tracking the Transition ID and user group.
Please provide a sample code using scriptrunner / any Post-Function which can be used for ReadOnly or any JMWE app to achieve the above as it will be a great help.
Thanks in advance.