Business rule for clearing a value is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 06:54 AM
I created a catalog item that has a variable called New Information Needed (this variable is a type = Yes/No). That variable is a Yes/No variable type and is REQUIRED. That variable is only visible on Task # 2 in my workflow which has a Rollback activity. So when the wf starts, Task 1 generates. I close complete the task, then Task # 2 generate and the New Information Needed variable is required. When you answer "yes" to that question and then mark the task Closed Complete - the rollback activity kicks in - which will cause Task # 2 to change from a state of Closed Complete to a State = Pending.
What I am looking to do is when that state changes to pending I want to clear the value of "Yes" in that task to "blank". I don't want any value in that field.
Here is my business rule which does not seem to be working:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 07:13 AM
So the Yes/No variable is a boolean type, so it's either true or false. So instead of setting it as an empty string set it as false and it should work. Also, you may not even need to do this as a script. You can set you condition of the state changing to -5 in the "When to run" section and set the value in the "actions" section.
Let me know if this helps,
Dylan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 07:37 AM
Thank you Dylan,
I tried doing it via a condition; however the "Pending" state is not in the list of values to select from. Maybe because I am doing this on the task table. And if I change the table to sc_task table the state values also DOES NOT include the "Pending" value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 07:44 AM
Ok so in that case it makes sense to script this out. I am noticing an error in your conditional. I think the correct syntax would be: current.state.changesTo(-5)
Then in your script you can set the field as false.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 07:59 AM