2016-06-09 16 views
0

Ich konnte erfolgreich ein Jira-Problem erstellen, jetzt möchte ich einen Anhang hinzufügen mit: api/2/issue/{issOrDrKey}/AnhängeFügen Sie einen Anhang hinzu mit: api/2/issue/{issOrDrKey}/Anhänge

Mein folgender VB-Code wird nicht funktionieren, irgendwelche Vorschläge bitte, wie das neu für mich ist, danke. Der Fehler, den ich bekommen ist: HTTP-Status 500 - Fehler bei der Analyse Content-Type

Sub JIRA_PostAttachment()

Dim phtml As String Dim oHttp As Object Dim strResponse As String

phtml = "https://jira.ae.sda.corp.test.com/rest/api/2/issue/IS-163/attachments" sVar = "" "file =" ": "" C: \ Benutzer \ c776469 \ FORM.msg" ""

Set oHttp = CreateObject("Microsoft.XMLHTTP") 
Call oHttp.Open("POST", pHtml, False) 
'oHttp.SetRequestHeader "Content-Type", "application/json" 
oHttp.SetRequestHeader "Content-Type", "multipart/form-data;Charset=UTF-8; boundary=" 
'oHttp.SetRequestHeader "Accept", "application/json" 
oHttp.SetRequestHeader "X-Atlassian-Token", "no-check" 

oHttp.SetRequestHeader "Authorization", "Basic Yzc4NjQ3OTpHaWxpdDIwMTY/" 

Call oHttp.Send(sVar) 

strResponse = oHttp.ResponseText 
MsgBox strResponse 

Set oHttp = Nothing 

End Sub

Antwort