Make field mandatory before Task can be closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 12:32 PM
Hello,
I have a variable called "Workflow Progression" that is only on a certain task that fires(UAT Testing Task) from the workflow at a certain point. The purpose of the field/variable is to ask what the workflow should do next: Move to Production, Move to RollBack or Close the request(closed skipped). This variable only appears on the UAT Task. I need to figure out how to get the field to only be Mandatory when the "Close Task" ui action button is clicked. We assign this task to different users so we need to open an update it without this field being mandatory all the time.
function onSubmit() {
if(g_form.getValue('state') == '3')
{
g_form.setMandatory('variables.workflow_progression', true);
return false;
}
}
This is what I came up with. Any help on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 12:38 PM
Hello,
Is this a custom field or catalog variable on sc_task?
-Pradeep Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 12:40 PM
This is a catalog item variable I created.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2018 01:36 PM
Thanks for the update. Here you go.
function onSubmit() {
var action = g_form.getActionName();
if(g_form.getValue('state') == '3' && action == 'close_sc_task')
{
g_form.setMandatory('variables.workflow_progression', true);
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 04:58 AM
so this is setting it mandatory for any catalog task and not just for a specific one(UAT). Is there a way to set it to mandatory only on a certain TASK. We have several different ones for the same RITM. We use a Review task, a estimated time to complete task, a development task, UAT task, and then a move to production task. I know that's not ideal, this was setup before I moved to this company. The Workflow progression is only on the UAT task.