How can we lock jira Custom field

m.mohsanfarid November 5, 2019

Can we lock fields so only we can change the default value and user cant change that, How we can make the fields lock and how it is usefull to lock them. Can someone explain

2 answers

0 votes
Patrick Heidel May 3, 2021

Hi there, 
i was searching for a solution, too. 

When I add a custom field i have the advanced option and can use Custom Text Field (read only) I guess it comes whit the free Version of the Jira Toolkit. 

With this option you get a read only permission Text field which can be edited by for example Scriptrunn.

Hope it helps its much easier, than using the above mentioned Workaround.

Best regards 
Patrick

0 votes
Joe Pitt
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2019

JIRA doesn't allow you to lock fields. The work around is to put the field on a transition screen for a transition with a condition of a particular project role. Then put the field ONLY on the view screen. Put the transition anywhere you want to be able to change the field. 

Thorsten Letschert _Decadis AG_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 8, 2019

As a small addition: you probably might want to add this transition as a global reflexive one, meaning 'From any status to itself' so that it's available for the allowed users all the time.

Like Joe Pitt likes this
Dilan Kaplan April 22, 2020

@Joe Pitt 

Would it be OK to explain this in a little more detail please?

I am creating a ticketing system that will collect various types of information based on the state the ticket is in. However I want to only allow some fields to be available for filling in once a specific transition has been made into a new state.

 

I hope this makes sense - I think your solution is what I am looking for but I don't understand it 100%

Joe Pitt
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 22, 2020

I don't know how to make it clearer. 

Only put the field on the transition screen where you want it filled in

Restrict the transition to user with a particular project role

Only put the field on the View screen, not the edit or create screen. If you only have one screen it is used for create, edit, and view. You need to create at least a view screen. I like to have all three, The create screen for only fields needed to create the issue, the edit screen for users working the issue, and the view screen that includes all the fields used by the issue including the ones only on transition screens. 

As @Thorsten Letschert _Decadis AG_ said you may want it always available

Read the documentation for how to limit transitions or make it a global (reflexive) one. 

Like # people like this
Dilan Kaplan April 22, 2020

Thank-you Joe. 
Much appreciated

DK

Rolf Lader
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2022

@Dilan Kaplanif you wanne have a state based display of custom fields as decribed above you can't achieve this with the standard Jira features.
In this case you need to use something like 'Behaviour' from Adapatvist/Scriptrunner, which allows you to show and hide fields depending on certain conditions. 

Suggest an answer

Log in or Sign up to answer