How to fetch approver comments from workflow script

shubhanshumishr
Kilo Contributor

I have a scenario where I have to get one project(item in the table) approved   from dynamic level of approvers and store their comments in a column in the table. This means when approver approves a project, he enters a comment which later is shown as an activity. I want to fetch that activity comment and store it in my current table itself.

I am looping the same Approval - user activity till i have users to approve. I think because of this approver_history is not working for me as it shows "user approval for 'username' is deleted as it no longer matches the approval rule get approval from users."

I want to know where are these approval activities are stored so that I can query it and get approver's comments.

servicenow 1.png

In the above image, I want to know how I can get the above typed comment and store it in the table.

I am fairly new to servicenow so i have very little idea about this. Any help will be highly appreciated. Thanks in advance

1 ACCEPTED SOLUTION

Gowrisankar Sat
Tera Guru

You need to query: "sys_journal_field" table with   element ID as sys_id of approval record and fetch "value" column, You need to make sure that you store the "value" column as soon as the approval record is approved.


View solution in original post

3 REPLIES 3

Gowrisankar Sat
Tera Guru

You need to query: "sys_journal_field" table with   element ID as sys_id of approval record and fetch "value" column, You need to make sure that you store the "value" column as soon as the approval record is approved.


Thank you Gowrisankar. This is what I was looking for. You rock man. Thanks a million


Hi Gowrisankar,



I also would like to know where the actual approver is stored. When I say actual approver i mean to ask about the approver who actually goes and approves the request rather than the approver who has been assigned the approval(delegate approver). i am trying to build a approval history which is as follows:


       


        Orignal approver: <Approver name>


        Actual approver: <Approver name>


        Action: Approved/Rejected


        Comment: <your comment here>



Thanks in advance,


Shubhanshu