How to add comments to an approval from the workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 09:50 AM
I have a workflow with 3 different group approvals, so 1-3 approval activities could be sent for the RITM depending on the variable answers. Is there a way to get the approval activity to add a comment to the approvals for that specific activity? I have tried adding task.comments = 'Comment Text' to the approval script, but it would then error out.
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 10:48 AM
A little confused where you are trying to add the comments. The Approval (sysapproval_approver) record or a Task record you're generating? You could try adding the comment to the Work Notes (EX: task.work_notes = "Approved the Record").

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 10:57 AM
I'm trying to add the comments directly to the approval when it is generated. The part that is making this tricky is the approval activity stays until there is an approval answer and the different approval all comes from the same source. So the original issue is approver doesn't know which part they are approving for since all the approval records look the same. So the communication gap in the approval is are they approving access to part A or B or A and B type of scenario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 11:37 AM
Ah, I understand. Then Zach's comment makes the most sense. Did something similar to his recommendation when I wanted to generate multiple Approval records, but created a Script Include that I called on the workflow instead of a Business Rule. Remember to grab the correct workflow activity, on the wf_activity table, and you should be good to go on whatever you create.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 10:52 AM
Since the approval activity doesn't have a 'task' object, these methods will throw an error. I haven't tried this before, but my suggestion would be this:
For each of your 3 approvals, have them launch their own subflow. Within each of those flows, have a 'run script' activity to generate the approval record. This way you have control of what content goes in the record, ie a comment. After the 'run script', have a 'manual approvals' activity to hold the workflow until they get approved or rejected. Then you could proceed with task creation (or whatever) in the subflow, or return the approval value back to the parent flow and handle the logic there, whichever makes most sense for your use case.
Hope this helps!