set Custom field read only when the value of another custom field reaches 4 in post function Edited

Hello Jira Masters,

I have two custom fields: DueDateCounter (number) and Due date for the Current Assignee (Date) ,

In each transition I have a post function that increases the DueDateCounter by 1 and then add two days to the due date for the Current Assignee custom field.
When DueDateCounter reaches 4 the due date for the Current Assignee  stays unchangeable and the DueDateCounter stop increasing.

the problem that any user can modify the Due date for the Current Assignee field by the option "click to edit" .
I need to create another post function that blocks this option when the value of DueDateCounter =4

Can you please help?

Thank you

 

1 answer

0 vote
Gaston Valente Community Champion Sep 20, 2017

Hi!

If the two fields are modified only by code, you can remove both of the fields from the edit screen, they should be only in the view screen.

If you remove the fields from the edit screen they will be "read-only" from the jira ui

Hello Gaston , Thank you for this quick response please tell me if you have an idea about  how to remove a custom field from edit screen in a post function ? (from the code)

Gaston Valente Community Champion Sep 20, 2017

Hi, may be I was not clear.

you need to modify the fields from the post functions just like your doing right know

the only change is to remove the field from the edit screen from the project configuration

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

235 views 1 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you