Behavior plugin: How do i make a field read only based on status or on transition?

Am trying to change the behavior of a date field to read only once the issue type has gone passed a certain status or on transition. Doesn't look like its possible using UI - when i add condition true for workflow step= "Open" then the field is read only on issue create as well as when editing.

Maybe usig script? and if so, any examples you can provide?


1 answer

1 accepted

0 votes
Accepted answer

You can make a field readonly using a Java script.


var FieldToBeMadeReadonly = document.getElementById('customfield_xxxxx');

FieldToBeMadeReadonly.disabled = true;

FieldToBeMadeReadonly.readonly = true;

Note: Make sure that you set the field parameter to false just before you submit the forms, else the field's value will be cleared. (You can refer the below script for the same)

var currentForm = document.getElementById('issue-workflow-transition');
currentForm.onsubmit = function()
FieldToBeMadeReadonly.disabled = false;
FieldToBeMadeReadonly.disabled =false;

We've disabled the plugin to work on other developments but can't wait to test this - Thank you!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,304 views 12 19
Read article

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