When using a script-based calculated field on a work item, how can I tell the Web UI to refresh the field?
![]()
Hi all,
I have a client that wants to calculate fields on a work item when the Filed Against (category) is changed. Specifically, they want:
- the Summary field to be automatically generated based on the assigned category, and
- the Owner field to be set to the person who has the role of Team Lead in the team assigned to the category
I have created calculated value scripts that do both of these things, but both of them require web lookup calls and so they use the workItem.setValue() function to set the value rather than blocking the UI.
This is working fine for the Summary field, which is text, and which appears to update virtually immediately as the user changes the Filed Against field. However, this is not working for the Owner field, which does not reflect the new value until the record is saved. In addition, I get two additional messages in the console
- the first one occurs when the old Owner is not a member of the team belonging to the new category
- the second one occurs when it gets a change notification from the setValue() function but doesn't think the value has changed.
I can ignore the messages in the console, but I really need to be able to show the changes in the UI before the record is saved.
Is there any function I can call that will force an update or refresh of the Owner field to reflect the changed value?
Please note - this is a CLM on Cloud instance and so I have to handle the update in Javascript on the client side. I can't use server extensions.
|
2 answers
![]() Bumping this up again - hopefully one of the RTC devs can help out?
|