Hello,
I am using Smart Attachments to group my Issues attachments into categories.
Now i need to add attachment to my Issue defining particular category of this Attachment via rest API. Is it possible? Below my siple code to add attachment. How should i modify that to be able to specify category?
Your answers dont need to be in VBA, Just give me idea how to specify the category please.
Public Function testAuthen()
Dim JiraService As New MSXML2.XMLHTTP60
Dim sFileDataStr As String
sPath = "C:\Users\user1\Desktop\filename.pdf"
Const STR_BOUNDARY As String = "abc123-xyz123"
sFileDataStr = "--" & STR_BOUNDARY & vbCrLf & _
"Content-Disposition: form-data; name=""file"";Filename = """ & Mid$(sPath, InStrRev(sPath, "\") + 1) & """" & vbCrLf & _
"Content-Type: application/octet-stream" & vbCrLf & _
vbCrLf & GetFileBytes(sPath) & vbCrLf & "--" & _
STR_BOUNDARY & "--"
With JiraService
.Open "POST", "myurl/rest/api/2/issue/CERT-63/attachments", False
.setRequestHeader "X-Atlassian-Token:", "no-check"
.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & STR_BOUNDARY
.setRequestHeader "Authorization", "Basic " & UserPassBase64
.send stringToByteArray(sFileDataStr)
MsgBox JiraService.Status
MsgBox JiraService.responseText
End With
End Function