I've definitely seen something like this built out in customer environments. They used a series of triggered actions in Task and Incident to compare the total number of Tasks to the number of Completed and Cancelled Tasks. When a Task is marked Completed these calculations were run to find out if it's the last one for that Incident and if so a prompt is generated for Incident resolution. As I recall Childfold is the function to use to calculate your Task counts. It'll take a bit of work to build out and test but I'm certain you can do it in the ISM product.
I would agree with Jonathan in that ChildFold would be your friend in this situation. Off the top of my head, in the likely scenario that all your tasks are generated at once on a request, then you could add a 'Resolve Request' button with visible logic to only show if it is the only active task e.g. (expression for demonstration purposes)
$(ChildFold("ServiceReq#", ParentLink_RecId, ServiceReqContainsTask, "1", "+", "$(Status == 'Active')") == 1)
If your tasks are added on an adhoc basis for whatever reason then you might choose to use a similar solution to above or perhaps use a PromptAndExecuteAction to run an action which fulfils the request.
Hope this helps
3 of 3 people found this helpful
I've recently worked on this same request and believe that I found a solution. If your environment is like mine, you'll Just need to add a new field and business rule to the task object. Then you'll use the PromptAndExecuteAction function in a triggered action which, after completing the last task, will prompt the user to either resolve the incident or create a new task for that ticket.
Here are the steps for setting this up:
- Open the Task object and add a new Boolean field. We won't be adding this field to a form so not a big deal what you name it.
- Go over to the Task business rules and create a new triggered action.
- On the first screen, just check the “On Update” box next to the Object Events line then click Next.
- On the second screen, hit the drop-down arrow for New Action Type and select "Update Object" then press Next.
- You’ll then need to locate the field that you just created and add an expression to it.
- When the edit expression window opens, add the following expression, click Ok, then Save the business rule.
$(IfAllSiblings("Incident#.Rev3", $(Status not in ("Closed", "Resolved")), $(Status in ("Completed", "Cancelled", "Rejected")),
$(PromptAndExecuteAction("$(Parent(Incident#.Rev3))", "This task belongs to an Incident with no other active Tasks. Choose [Yes] to Resolve,
[No] to add a new task, or [Cancel] to go back.", "Resolve Incident", "Add New Task"))))
Note: The expression might need some adjusting depending on the names of your business objects, statuses and the quick actions in your environment. I also had to create a new quick action,
named "Add New Task" that prompts users to select a new team to assign the ticket to.
- Now when users complete the last task it should give them the following prompt after they click OK.
- Yes will trigger the first action in the expression, which is Resolve Incident.
- No, will prompt the user to Add A New Task, which is the second action named in the expression.
- Cancel will just return them to the previous screen.
Here are some of the links that helped me solve this one:
Hopefully this helps you out and if you have any questions let me know.
I've done as per the above, however the task that's being created is not linking as a child to the open Incident.
It's all working correctly apart from this so I believe it could be an issue with the Quick action.
Can you please show me they Quick action you've used and I can compare?
I experience the same behavior. The task is created but it is not linked to the parent incident.
You need to make sure the quick action is in the Incident not the Task.
I was coming back to say exactly that. Thank you everyone.