I want to implement a function where you cannot mark any incident or sctask closed state = on hold

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 11:20 AM
Hello,
What is the best way to implement:
scTask or Incident cannot be closed if the current state is "On Hold"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 11:30 AM
I'd use an onBefore BR on each table (sc_req_task and incident) which has an if statement looking at the state, abandoning the save action if on hold or pending. This will work if its an automated action trying to close the record, but will allow an end user to try. You can couple this with a condition on the UI Action, which hides it (not available) when on hold/pending so that Agents/Techs/Fulfillers can't try to close it, until it is in an appropriate state.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 11:31 AM
You would basically need a business rule to abort action, if the current state is closed.
You can use current.setAbortAction(true) to abort the action.
Please mark this response as correct or helpful if it assisted you with your question.