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?

Thanks!

1 answer

1 accepted

This widget could not be displayed.

You can make a field readonly using a Java script.

Example:

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

203 views 1 3
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