How can we make all the attributes as read-only if the required tags are present
Hi Team,
In the Workitem ,As soon as the sequential approval tags are present in the tags attribute , I would like to have a read-only state for all attributes , except for the approval action and tags in order to avoid implementing a dedicated state and this needs to be done for Team Member and Stakeholder.Otherwise the sequential approval would not be able to modify.So tags and approval action should be editable, other attributes should be read only we would need this only for in progress state.
Please Suggest
Thank you
One answer
You have the following options to make attributes read-only with out of the box capabilities.
- The precondition/advisor read-only by type and state.
-
The precondition/advisor read-only by condition, which works using a Javascript condition. See https://rsjazz.wordpress.com/2022/11/25/ewm-attribute-customization-introduction/ for an introduction .
Another option would be creating a custom work item save precondition/advisor that prevents saving the work item based on the rules it tests for. This is possible, but quite costly and can usually not be deployed in cloud hosted environments.
'approval action should be editable' this makes no sense. Actions are not editable. Actions can be performed based on permissions and roles. The preconditions above can not control actions. A custom preconditions could prevent actions being performed based on some criteria.
Comments
As Ralph says above, the only approach is number 2 where you would create a custom Javascript based Condition that fetches whatever information you need to check from the work item, and then returns true or false.
Then you use the Condition script in the "Preconditions & Follow-up Actions" area with a "Read-Only Attributes For Condition" precondition to mark whatever fields you want as read-only if the code returns true.
1 vote