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

Global Checkmark is checked. And I did try Data Policies but I could not find how to get to individual variables in the data policy rules. There was just an option for variables but no plus on it to expand.

Calvert_0-1670606043056.png

 

Yeah... you are right.

You are essentially trying to make one of the variables mandatory in the workspace view right?

Then start testing that UI policy separately for the workspace view. What I mean is, remove the global checkmark and enter workspace on the view.

Another idea is to try a client script the same way.

Now, another important topic is that client policies (and scripts) only apply to fields if those fields are displayed in the form, otherwise they are ignored. I assume the field you are trying to make mandatory is being displayed on the workspace view of the form.

 

SebastianDL_0-1670610237466.png

 

 


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


Yeah and the UI policy works on the workspace IF I manually change the state to Closed Complete. In the native view clicking the Close Task UI Action changes the state and then the UI policies kick in. While workspace Close Task UI action looks like it changes the state on the server side so my client scripts and policies never trigger.

 

I have found a workaround by building some simple validation into the UI action. While in the workspace if the variable is empty then stop the submit and show an error. Not perfect but it gets the job done.