The CreatorCon Call for Content is officially open! Get started here.

Close the catalog task based on variable value

User496103
Tera Contributor

hello ,

I have a requirement that catalog task should be closed complete when the variable "Approve" is set to yes and Planned Date is not empty . If this 2 value are set in the variable then the catalog task should be set to closed complete.

Thanks and Regards,

Sheetal

1 ACCEPTED SOLUTION

Voona Rohila
Mega Patron
Mega Patron

Hi sheetal

can you share what did you try so far?

you can try a before update BR with conditions as state || changes to || closed complete.

in your BR Code, use below logic

modify variable names and values accordingly.

if(current.variables.approve != 'yes' && current.variables.pllaned_date != '' )
{

gs.addErrorMessage("Cannot close CTASK");
current.setAbortAction(true);
}

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

2 REPLIES 2

Voona Rohila
Mega Patron
Mega Patron

Hi sheetal

can you share what did you try so far?

you can try a before update BR with conditions as state || changes to || closed complete.

in your BR Code, use below logic

modify variable names and values accordingly.

if(current.variables.approve != 'yes' && current.variables.pllaned_date != '' )
{

gs.addErrorMessage("Cannot close CTASK");
current.setAbortAction(true);
}

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

ersureshbe
Giga Sage
Giga Sage

Hi,

You can control in workflow. You can achieve with the help of

if(current.variables.variable_name == 'Yes'){

task.state = 'Closed Complete State Number';

 

}

 

Regards,

Suresh.

Regards,
Suresh.