I’m facing an issue with approvals on a custom table that extends Task.

nikhil88c
Tera Expert

Scenario:

  • I created a custom table extending Task.
  • Added a new State choice called “Awaiting Approval”.
  • Built a Flow Designer flow with the following logic:
    • Trigger: Record updated → State changes to Awaiting Approval
    • Action: Ask for Approval
    • If Approved → Update State to Closed Complete
    • If Rejected → Update State to Closed Incomplete

Issue:

  • When I create a new record and change the state to Awaiting Approval, the approval record is created.
  • However, the approval immediately changes to “No longer required” and State is going to closed complete instead of waiting for the approver’s response.

    nikhil88c_0-1769931695282.png

     

1 ACCEPTED SOLUTION

nikhil88c
Tera Expert

 

Root cause:


There is a BR Running, "Task Active State Management" which calls script Include: "TaskStateUtil",

In the TaskStateUtil Script Include, there are default inactive (closed) state values defined (for example: 3, 4, 7).

nikhil88c_2-1770372131601.png

 

When I created the Awaiting Approval choice, I assigned it the value 3, which is treated by the platform as a closed/inactive state.

Because of this:

  • The Task Active State Management business rule detected the state as inactive
  • active was automatically set to false
  • Since the record became inactive, the approval engine updated approval to “No Longer Required”

Resolution

The fix was to ensure that “Awaiting Approval” is treated as an open/active state:

  • Changed the choice value of Awaiting Approval to an open state value (not included in close_states)

Once the state value was no longer considered an inactive/closed state:

  • The record remained active
  • The approval flow triggered as expected

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@nikhil88c 

share screenshot of "Ask for Approval" flow action

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

nikhil88c
Tera Expert

 

Root cause:


There is a BR Running, "Task Active State Management" which calls script Include: "TaskStateUtil",

In the TaskStateUtil Script Include, there are default inactive (closed) state values defined (for example: 3, 4, 7).

nikhil88c_2-1770372131601.png

 

When I created the Awaiting Approval choice, I assigned it the value 3, which is treated by the platform as a closed/inactive state.

Because of this:

  • The Task Active State Management business rule detected the state as inactive
  • active was automatically set to false
  • Since the record became inactive, the approval engine updated approval to “No Longer Required”

Resolution

The fix was to ensure that “Awaiting Approval” is treated as an open/active state:

  • Changed the choice value of Awaiting Approval to an open state value (not included in close_states)

Once the state value was no longer considered an inactive/closed state:

  • The record remained active
  • The approval flow triggered as expected