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

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
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...

167 views 1 17
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