Where are Incident activities in the Table API?

thedavegray
Giga Expert

Hi, 

Can anyone please tell me the table name I should use to get the activities stored against an Incident (incident) in the API?  

 

I have tried a lot, including incident, task, wf_activity etc but I really can't find where these are stored. 

 

Also looked at the schema map and I'm still none the wiser 😞 

 

Thanks 

 

This is a test INC and it has 11 activities against it. 

 

thedavegray_0-1676552481267.png

 

5 REPLIES 5

New Developer_S
Giga Sage

Hi,

 

Activities comes from Activity Formatter. Please refer the link below .

https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/form-administration/...

Please give a thumbup or mark my answer helpful if it needed answer.

thanks,

 

Rajesh Chopade1
Mega Sage

Hi @thedavegray 

 

You will get activities by following ways

 

var payload ='';
payload += addToPayload("comments", current.comments.getJournalEntry(-1));
payload += addToPayload("work_notes", current.work_notes.getJournalEntry(-1));

function addToPayload(element, value) {
        var jsonline = '';
        jsonline += '"' + element + '":' + global.JSON.stringify(value + "") + ',\n';
        return jsonline;
    }

 

I hope this will helps you.

 

Mark my answer correct and helpful if it helps you to resolve your issue.

 

Thank you

Rajesh.

Hi @Rajesh Chopade1 

Thanks for the info. 

 

I will be consuming the API using C# or Azure Data Factory and doing my testing in Postman.  

Do you know how I would add that logic to a Postman request? 

 

Thanks 

Mahesh Baraskar
Mega Guru

Hi @thedavegray 

 

The activities that you see in Notes section come from sys_journal_field table.

 

You can see the records by this link:  https://YOUR INSTANCE NAME/sys_journal_field_list.do

 

Please mark the answer as helpful and correct if this solves your question.