Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Response not in correct format

Arumugam December 28, 2020

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

1 answer

0 votes
Sudarshan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 31, 2020

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?

Arumugam December 31, 2020

@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.

Sudarshan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 31, 2020

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.

https://confluence.atlassian.com/jirakb/troubleshoot-character-display-issues-in-jira-server-203394762.html

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.

Sudarshan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2021

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events