On sc_task assigned to be mandatory when one changes task from open to work in progress

charanpatnala
Tera Contributor
 
3 REPLIES 3

Josh Pirozzi
Kilo Sage

Hey @charanpatnala,

 

Without providing any details on what you've tried, or if there is an issue, I can't go off of much other than providing the 'How To'.

 

You can use a UI Policy to set these options on a Form Field. You'd set the condition to:

  • State = In Progress
  • UI Policy Action: Assigned To - Mandatory = True.

Sorry, Actually requirement is when I try to change the state from open to work in progress the assigned to field has to be mandatory 

1)I tried this using business rule, here I can able to show the error message but to set mandatory (*) symbol on form there is no option in business rule.

2) Next i tried using UI policy, here it doesn't have previous or old value just we can set Mandatory true when state is work in progress but not when state changes to work in progress from open scenario 

3)And also i tried using client script, taking oldvalue and newvalue from the script i attached you can see I wrote the code when only old value is open and new value is work in progress but is working for the states also 

I hope you understand my explanation let me know incase if you need more clarification.

charanpatnala
Tera Contributor

Hey apologies, Issue: "Assigned To" Should Be Mandatory When Moving from Open to Work in Progress, But It’s Not Working

 

I am trying to enforce a rule in SC Task (sc_task) where the "Assigned To" field must be mandatory when transitioning from Open to Work in Progress. However, the approaches I’ve tried are not working as expected.

 

What I Have Tried:

UI Policy:

 

Created a UI Policy to make "Assigned To" mandatory when the State changes to Work in Progress.

This works in the form view only when state is work in progress but not when state changes from open to work in progress.

2.Business Rule (before update):

 

Wrote a Business Rule to check if the State is changing from Open to Work in Progress and if "Assigned To" is empty.

Used gs.addErrorMessage() and current.setAbortAction(true); 

This code will show error message but not sets mandatory (*) symbol on assigned to field.

3.

Client Script (onChange):

  • Used g_form.setMandatory('assigned_to', true); when the State field changes to Work in Progress. I have attached the script i tried it is also not working as it is showing mandatory even though if it is not moving from open to work in progress