Forums

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

How to restrict to edit custom field in particular status with script?

OOoo October 17, 2022

I have seen solution in How-to-restrict-to-edit-custom-field-in-particular-status 

This solution not work with my situation, because my Jira application has thousands  project and nearly hundred workflow.It's very difficult to add restrict by project or workflow.

So how can I deal with the restrict?

1 answer

0 votes
Alex Koxaras _Relational_
Community Champion
October 17, 2022

Hi @OOoo and welcome to the community,

If with the solution you are referring to, restrict a custom field from editing per se is not possible. Without knowing your business requirement I would propose two solutions:

  • With Scriptrinner: Create a behaviour and make this field read only. Use mappings to select where this field should be read-only. Most likely you will need to create a couple of behaviours, if statuses are different (or write a script)
  • Without Scriptrunner: Remove the specific custom field from all the edit screens you want. Create a self transition with a transition screen, to which this field will be placed. Insert a condition to that workflow to appear only is the status equals to your desirable status.
OOoo October 20, 2022

Hi @Alex Koxaras _Relational_ thank you  for your reply,

My server environment:JIRA v7.3.6 standalone version

Speaking of Scriptrunner, do you mean scriptrunner-for-jira ? I cannot find script runner in my jira app.

The second solution you mentioned, have to do a lot config, cannot be done in my company.

Is there any other solution with groovy script or other programmatically?

Alex Koxaras _Relational_
Community Champion
October 20, 2022

@OOoo 

Yes, I'm referring to that application. You can use behaviours to do what you want. But the idea is that:

  • For a specific field
  • During a transition
  • You make it read-only
  • After the issue transitions to another status, you make this field writable again

Suggest an answer

Log in or Sign up to answer