I am sending the follow data via POST call:
sURL = sJIRAInstance & "/rest/api/latest/issue"
sData = " { ""fields"" : { ""project"" : { ""key"" : """ & sProject & """ }, ""customfield_10229"" : """ & Trim(sText) & """ , ""summary"" : """ & sSummary & """, ""description"" : """ & sDescription & """, ""assignee"" : { ""name"" : """ & sAssigneeName & """ }, ""issuetype"" : { ""name"" : """ & sIssueType & """ } } } "
Debug.Print sData
With JiraService
DoEvents
.Open "POST", sURL, False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "Basic " & UserPassBase64
.SetRequestHeader "X-Atlassian-Token", "nocheck"
.Send (sData)
If .Status = "401" Then
MsgBox "Not authorized or invalid username/password"
Else
End If
End With
However, because there is a newline feed for sText variable, I am getting error response 400. As an example, sText has value like below in two sentences:
ABC
DEF
I am setting sText like below:
sText = sText & Chr(13) & Worksheets("Create JIRA Issues").Cells(k, "C")
How can I pass a variable with two or more lines of data?