
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 12:03 AM
I am facing a situation where below function is not returning the appropriate format in base64. Base64 format starts with /9 however, we are getting (binData) it in the format of
77+977+977+977+9ABBKRklGAAEBAQB4AHgAAO+/ve+/v.................
var binData = StringUtil.base64Encode(response.getBody());
Please suggest.
Thanks
Rohit
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2017 04:48 AM
Thanks Ujjawal, It returned the same. ServiceNow said it doesn;t support images etc in REST API.
However, please refer to the below link as my issue was resolved via different method.
Inserting Attachments in ServiceNow from JIRA without MID-Server using REST

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 12:23 AM
Hi Rohit,
How are you validating that it is not returning the correct value.
For validating you can use below mentioned code to encode and decode it back in background script.
var base64string = GlideStringUtil.base64Encode("Your response");
var abc=GlideStringUtil.base64Decode(base64string);
gs.print(abc);
If you still see the difference or any issue then please do let me know.
Hope this helps.
Regards
Ujjawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2017 04:48 AM
Thanks Ujjawal, It returned the same. ServiceNow said it doesn;t support images etc in REST API.
However, please refer to the below link as my issue was resolved via different method.
Inserting Attachments in ServiceNow from JIRA without MID-Server using REST