Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to make a field read only based on status

As an admin, I'd like to make all but three fields read only after a certain transition.

Further, I'd like to make all fields read only once the ticket is closed.

 

2 answers

2 accepted

1 vote
Answer accepted
Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 10, 2023

Hi,

To make all fields read-only once the ticket is closed, you will have to set the property that status:

Property Key = jira.issue.editable

Property Value = false

For making some of the fields read only after a certain transition, you can try using the workflow post functions for this transition.

Hope this helps.

Thanks,
Vamsi

Hey Vamsi, thanks for this! 

Thank you for your response.

The solution for making all of the fields read-only works. However, I have not found any post function that can set a field at this level.

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 11, 2023

Hi @Jamis A_ Mack

If you have ScriptRunner installed, you can use Behaviors to implement this.

def custom_field_1 = getFieldById("customfield_12345")
def custom_field_2 = getFieldById("customfield_67890")


if (underlyingIssue.getStatus().name == "Status Name") {
    custom_field_1.setReadOnly(true);
    custom_field_2.setReadOnly(true);
}
else {
    custom_field_1.setReadOnly(false);
    custom_field_2.setReadOnly(false);

}

Hope this helps.

Thanks,
Vamsi

Like Jamis A_ Mack likes this

Will this work in Behaviors Cloud? How can we restrict the field for group or role?

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 10, 2023

Jira doesn't have a function for this.

There is an ugly "fix" for it, which involves moving all of your "edit" functionality into the workflow, but I doubt you really want to do it.

Just for giggles, how would that work?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 11, 2023

You remove the fields you don't want people to edit from the "edit" screen for the issue type, then edit the workflow, adding looped transitions that use a screen that does have the fields.  You add them to any status that you want to allow fields to be edited. Looped transitions go back to where they started, they don't appear to change the status, but they can take you through a different "edit" screen.

It's ugly, but it does the job.

Like # people like this

Suggest an answer

Log in or Sign up to answer