HI Peter,
I would suggest to create this validation rule on the parent link creation and not on the Work Item. Your validation should be: $Parent.Phase='Archived'.
Please let me know if that worked.
Regards,
Tamir
I have a validation rule that prevents updates on work items if the work item or parents have Phase="Archived".
You are allowed to change the parent of an Archived work items.
CurrentUser()<>'BleauSystem' &&
(Not IsTriggeredBy('API') || Not IsTriggeredBy('Counters')) &&
Not IsChanged($Parent) &&
(
(If(($Phase='Archived'),1,0) +
If((Not(IsNull($Parent)) && $Parent.Phase='Archived'),1,0) +
If((Not(IsNull($Parent.Parent)) && $Parent.Parent.Phase='Archived'),1,0) +
If((Not(IsNull($Project)) && $Project.Phase='Archived'),1,0)
)
0) &&
Not IsChanged($Phase)
However, I'd like "Not IsChanged($Parent)" part to take into account that you should not be allowed to change the parent so CurrentObject() is below and Archived work item, that is, you should be allowed to move Archived work items around but not make them child under an archived work item, so something like this:
(Not IsChanged($Parent) unless ($Parent.Phase='Archived'))
Anyone with hints?
Please sign in to leave a comment.
HI Peter,
I would suggest to create this validation rule on the parent link creation and not on the Work Item. Your validation should be: $Parent.Phase='Archived'.
Please let me know if that worked.
Regards,
Tamir
Hi Tamir
Thanks. So you don't think it's possible to have all in one validation rule?
Hi Peter,
I don't think it is possible to have it under one rule.
Tamir