UI Action acting differently on the Workspace, not changing state before closing the task

Calvert
Tera Contributor

I have a UI action to Close Task. It sets the current state to Closed Complete and Updates the ticket:

current.state = 3;
current.update();

 

I also have a UI policy that if the State is Closed Complete it makes additional fields mandatory. In native view this is working as expected, I click the Close Task button, the state changes to Closed Complete and then the mandatory fields are not filed out and it stops the submit.

 

In Workspace I think the Close Task button and the task just closes. The fields are not made mandatory per the UI Policy even though after its closed the state is Closed Complete. It is skipping over my UI policy for state is Closed Complete and closing the task anyway.

 

Is there a way I can force it to check the UI policy before close in the workspace view? Or a better way to ensure variables are made mandatory before submitting?

7 REPLIES 7

Sebas Di Loreto
Kilo Sage
Kilo Sage

@Calvert 

Can you add a screenshot of your UI policy?

That will allow me to help you.

 

I recreated your case on my instance and it is working consistently between the platform and workspace views.


If I helped you with your case, please click the Thumb Icon and mark as Correct.


Here is the script in the UI Policy. The When to Apply is State = Closed Complete, but since I cannot access variables from the normal UI Policy I needed to set the script. It would be preferable to run in a Catalog UI Policy but I cannot access the form fields from there.

2022-12-08 10_51_45-Make Approver Required _ UI Policy _ Verra Mobility _ Service Management.png

Do you have global with a checkmark?

 

SebastianDL_0-1670539405553.png

 


If I helped you with your case, please click the Thumb Icon and mark as Correct.


Have you tried doing this with a data policy? You can access the variables since that is server code.


If I helped you with your case, please click the Thumb Icon and mark as Correct.