I am trying to use excel vba to create an issue thru Rest API, but it is always failed. The code I am using is as follows:
Public Function JiraUpdateTicketA(JsonUpdate As String, issueKey As String) As String
Dim JiraService As New MSXML2.XMLHTTP60
Dim json As Object
usernamep = UserPassBase64
With JiraService
.Open "POST", GetUrl + "/rest/api/2/issue/", False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "Basic " & usernamep
.Send JsonUpdate
End With
End Function
And the JasonUpdate data I posted is as follows:
{"fields":{"project":{"key":"AUTODFIRSE"},"issuetype":{"name":"Bug"},{"summary":"RDETST_AutoCreation"},{"description":"Start"},"priority":{"id":"3"},"versions":[{"id":"104602"} ],"components":[{"id":"29300"} ]}}
Does anyone know what the issue it is?
JIRA version I used is v6.4.13.
Any help is appreciated!
Community moderators have prevented the ability to post new answers.
What error are you getting?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, that's a generic headline, not the error.
Consider this case: "I want to play with penguins". Error message: "you can't". Accurate, but useless. Because the real error is missing.
Please tell us what the error message is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for that, from excel vba I only print the returned text,not the whole http response. And I have some try with other comments in other thread and it works now for me. What I need to do is to add a "original" in request header like this; SetRequestHeader "Origin", "http://jira.xxx.xxx/". But I still do not know why it is. I am not sure if this should be comments in the documentation. Thanks!~
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.