Hi All,
I am using excel macro to connect to JIRA API. The response status appears as 201 created whereas the responseCode gets returned as ? ?????????????????????????????????????????? ???] . Could anyone let me know why. Below is the code:-
>>>>CODE:
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
UserNameP = UserPassBase64
URL = "http://jira/rest/api/2/issue/"
strPayLoad = "{" & vbCrLf & Chr(34) & "fields" & Chr(34) & ":" &
objHTTP.Open "POST", URL, False
objHTTP.setRequestHeader "Content-Type", "application/json"
objHTTP.setRequestHeader "Accept-Encoding", "gzip, deflate,br"
objHTTP.setRequestHeader "Accept-Encoding", "identity, deflate"
objHTTP.setRequestHeader "Authorization", "Basic " & UserNameP
objHTTP.setProxy 2, "proxy:80", ""
objHTTP.send (strPayLoad)
strResponseStatus = objHTTP.Status --201 is returned here correctly.
strResponseText = objHTTP.responseText
<<<< END OF CODE
Hello @Arumugam
the response text should not be a "?".
it should be a URL for the created item.
Since your response 201 is good, there seems to-be a small texting issue with the response test
can you check the below points?
1. is there any other language other than English in your computer?
2. anything on unicode?
@sudarshan: I checked, I only have English United States in my system and no other language. Also could you please teach me how to add Unicode in my above request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have never tried excel VBA with Jira, so i ll try it out and get back (next year :D)
UTF-8 should be the recommended encoding across all your places (server, db, etc...)
check the below article.
if there is no luck, raise a support ticket.
since your response code is correct and only the text is bad, it should be a known issue to the support.
Wish you a happy new year 2021.!
Let's wait for other answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Happy new year 2021.!
I tried my first attempt with excel and Jira - was a little tight initially but got it through.
But I could not replicate your issue, and everything works normal at my end...!
I suggest, if the issue is still there, then why don't you create a new piece of the code writing, i seriously suspect that the "??" response is due to a cache.
Infact you should not be getting such response with present day systems and jira.! :)
(I am just saying that nowadays such data related conversion issues are mostly handled by many applications internally)
for VBA, the normal functions will take care of the Unicode conversion, I have used CharW using a long input.
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/chr-function
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.