How to create an incident along with adding an attachment via Rest API post call
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2024 04:48 AM
Hi Team,
Team,
I wrote a scripted API and trying to post the data from rest API explored, but i dont see provision to add attachement data from explorer to test the case.
May i know how to achive this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 10:25 PM
We have implemented this, there's a OOB function for this setRequestBodyFromAttachment()
Sample:
It works smoothly, no need of additional code.
Please mark my response as Answered or Helpful if it had done so
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2024 10:50 PM
Hi Chankya,
Thanks for the mail. I can try that , but initially the data is not populating to source attachment fields from the Rest API explorer which i am currently having no clue why
Regards,
Srinivas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2024 04:16 AM
Team,
Finally i am able to create a record and also attachment also getting added. But the added attachement is showing as undefined.
gs.log is showing filename,filecontenttype and content logged as undefined.
Below is the script: