- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 02:46 PM
I have a business requirement to hide or delete all previous approval items and only show the current ones from the updated flow after a reject.
I tried creating a business rule to just filter out no longer required and cancelled, etc. but that didn't meet their requirements.
The business person has gone to the forum with the question and the forum gave them this response:
"Yes, it is possible to remove approvals in ServiceNow when a change is rejected and sent back to a new state. This can be achieved using a business rule or workflow that triggers when a change is moved back to the new state.
In the business rule, you can write a script that removes any approvals associated with the change when it is moved back to the new state.
Alternatively, you can use a workflow to automatically remove the approvals and associated notes when a change is moved back to the new state. This can be done using a "Delete Record" action in the workflow.
Removing approvals and associated notes when a change is moved back to the new state can help keep the change record clean and organized, and it can also help prevent confusion among stakeholders who may see outdated approval information."
So now I'm stuck writing the script that this friendly person said was possible. Where do I even start? How to I reference the past flows in the glide record but not accidentally delete the records from other requests/changes/etc.?
I'm not asking for you to write the script - just help in finding my way on this. Thanks. Any good article links? Any training that specifically shows me how to only touch the things related to the current request/change etc?
Thanks.
Signed Lost Newbie Admin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2023 11:01 AM
That is to say: It is not the business stakeholder's jurisdiction to dictate the method.
It is only their jurisdiction to articulate the pain they're having.
You haven't been told the pain. You've been told one person's hair brained scheme to solve a problem you don't even know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2023 11:00 AM
Lets try to really articulate the problem: Is the stakeholder confused by seeing lots of approval records on the change because its gone through 1 or more phases of rejection?
If that's the case, you COULD just filter that related list so it only shows pending and approved approvals.
Why is *DELETION* absolutely necessary. That sounds like a bad case of the Amish-Long-Distance-Travel Problem.
Ask an Amish farmer how to get from PA to FL and they'll talk about where to change horses, what roads they can take, the size of the wagon they'll need, and how much dried goods to pack for the multi-day journey. That is to say, they'll describe a path to a desired outcome ONLY in the context they already know.
But there are WAY better ways to reach the outcome... like taking an airplane.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2023 11:01 AM
That is to say: It is not the business stakeholder's jurisdiction to dictate the method.
It is only their jurisdiction to articulate the pain they're having.
You haven't been told the pain. You've been told one person's hair brained scheme to solve a problem you don't even know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 02:34 PM
I know I accepted a solution on this but it came back up today. We have a UI Action to revert to new and they want that to delete "all" of the approval records related to the exsiting request - so none of the previous approvals show as no longer needed, cancelled, or approved, etc. so I do need a script to do that... and I'm just hitting a wall with it.
I am able to get it back to new but I need those related record of approvals to delete.
Here's the existing script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 02:36 PM