2

I am attempting to create a custom field in youtrack who's value changes along with state changes in another field. I was wondering if there was a simple way to make this field read-only in the UI so that it cannot get out of sync with what it should be.

My current solution is to assert the correct states in a changed event (my actual rule is more complex):

rule Department should only be changed automatically

when Department.changed {
  var message = "Department change not allowed";
  assert Department != {Product Management} || State != {Submitted}: message;
  assert Department != {Development} || (State != {Open} && State != {In Progress}): message;
}

The issue is that if I want to tweak the state machine driving everything, I need to remember to come back to this rule as well to make sure everything remains consistent. Is there a better way to achieve this?

Steve Czetty
  • 6,147
  • 9
  • 39
  • 48

1 Answers1

1

Your point is clear, but there's no way to make a field read-only in UI while keeping it updatable by a state machine.

Jk1
  • 11,233
  • 9
  • 54
  • 64
Alex.V
  • 2,081
  • 14
  • 13