Hey there @AlexC !
Taking a look at the GitLab API, they do not support uploading files at all: https://docs.gitlab.com/ee/api/issues.html#new-issue
As @MohSwellam mentioned, there is the ability to add “Metrics Images” to issues via a dedicated endpoint, but that is only for “Incident” issues: https://docs.gitlab.com/ee/api/issues.html#upload-metric-image
If you needed to upload real files, I would recommend perhaps dropping them in a Dropbox, Box, GDrive, etc. app and then including a link to the file inside of the issue itself!
Hi @AlexC
If you can post the response you get from the ZenDesk trigger we might be able to help you better.
There should be a field called “content_url”
Usually such files have the value “Exists but not Shown”
Hi @MohSwellam,
here is the response from the Zendesk trigger. I see the content of the attachments section. Actually I need only the content of the fields content_url and could provide them to the GitLab issue. I just don’t know how to extract them and hand them over to the issue. It could be just one or many attachments, so I would have to check how many entries are inside the attachments field. Or extract all the URLs only. Do you have an idea?
Thanks a lot for your help!
attachments:
url: https://xportde.zendesk.com/api/v2/attachments/XXXXX.json
id: XXXXX
file_name: Bildschirmfoto 2022-10-06 um 10.36.22.png
content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=Bildschirmfoto+2022-10-06+um+10.36.22.png
mapped_content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=Bildschirmfoto+2022-10-06+um+10.36.22.png
content_type: image/png
size: 584888
width: null
height: null
inline: false
deleted: false
malware_access_override: false
malware_scan_result: malware_not_found
thumbnails:
url: https://xportde.zendesk.com/api/v2/attachments/XXXXX.json
id: XXXXX
file_name: Bildschirmfoto_2022-10-06_um_10.36.22_thumb.png
content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=Bildschirmfoto_2022-10-06_um_10.36.22_thumb.png
mapped_content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=Bildschirmfoto_2022-10-06_um_10.36.22_thumb.png
content_type: image/png
size: 4114
width: 62
height: 80
inline: false
deleted: false
malware_access_override: false
malware_scan_result: malware_not_found
url: https://xportde.zendesk.com/api/v2/attachments/XXXXX.json
id: XXXXX
file_name: hellohotel-factsheet-email.pdf
content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=hellohotel-factsheet-email.pdf
mapped_content_url: https://xportde.zendesk.com/attachments/token/XXXXX/?name=hellohotel-factsheet-email.pdf
content_type: application/pdf
size: 2022809
width: null
height: null
inline: false
deleted: false
malware_access_override: false
malware_scan_result: malware_not_found
thumbnails:
So it seems GitLab Create Issue endpoint doesn't support adding an image.
Referencing GitLAb API, it seems you can only upload “metric” images to Incident Issues using this end point
POST /projects/:id/issues/:issue_iid/metric_images
So if that works for you then you can use Webhooks by Zapier to achieve that.
Hi @AlexC!
Did you try giving @RALaBarge’s suggestion a go and if so did it work for you? Also if you were able to find another way to add the files you need to gitlab, we’d love to know the workaround that you used.
Thanks!