Workflow's IssueAttachment -> base64

Hello!
Trying to get base64 content of new issue attachment in workflow's  Issue.onChange(), like it is implemented in REST api (field base64Content of IssueAttachment).
Can't use REST api because new attachment is not available yet in Issue.onChange(),
so have to use workflow api, but can't find any fields or methods to get base64 attachment data.
Also
- couldn't find any documentation for IssueAttachment.content field format, only realised it belongs to class jetbrains.youtrack.workflow.sandbox.InputStreamWrapper.
- found out native js btoa() and atob() aren't available.


Is there any options to get base64 content of an attachment using workflow js api without implementing base64 by myself?

2 comments
Comment actions Permalink
Official comment

Hello Nick!

> couldn't find any documentation for IssueAttachment.content field format, only realised it belongs to class jetbrains.youtrack.workflow.sandbox.InputStreamWrapper.

Here's the link to the docs: https://www.jetbrains.com/help/youtrack/incloud/v1-IssueAttachment.html#properties
There you can find the description of the 'content' property.

> Is there any options to get base64 content of an attachment using workflow js api without implementing base64 by myself?

Unfortunately, no. We've created a feature request https://youtrack.jetbrains.com/issue/JT-59500, please subscribe to it and vote it in our tracker.

Comment actions Permalink

Thanks for reply!

0

Please sign in to leave a comment.