Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tRESTClient receives empty response

Hi there,
We are also using Jira and we wanted to use the RestApi to get various data out of it. So I tried Talend for this. I'm using Talend Enterprise ESB 5.3 for this integration job. My current job looks like this:
tRESTClient_1-------------tExtractJSONFields_1-----------tLogRow_1
The Jira installation is only reachable via SSL so I use the truststore in the JVM arguments. I don't know if this information is relevant.
Because of this the URL is (for example) "https://jira/", the relative path is "/rest/api/2/project", http method is "get" and the accept type is "JSON". Calling this URL in the browser works and I receive the specific JSOn response like this:

While executing the talend job it seems that I just receive empty brackets: "[]"
I hope you can help me with that. If you need any further information just aks 🙂
Thanks in advance and best regards,
Dominic
Labels (4)
6 Replies
Anonymous
Not applicable
Author

There might be a wrong configuration on tExtractJSONFields_1, what's the result printed on the console if you link directly tRESTClient_1 to tLogRow?
Shong
Anonymous
Not applicable
Author

Unfortunately only the 2 brackets with the pipe at the end "[]|"
Thanks for the fast reply
Anonymous
Not applicable
Author

I have still this issue...
What was very strange. That the talend esb doesn't use my current editing job. It's started another job wit tRest. So the tRest component received the 2 brackets. After I saw this I started the job with the tRestClient and it didn't work with the same keystore. It shows me now the following exception: java.io.IOException: IOException invoking https://jira/rest/api/2/project: HTTPS hostname wrong: should be <jira>
Why the behavior of handling SSL authentication differs between tRestClient and tRest?
Today we got the license for Talend ESB 5.4.1 I am using this now.
Anonymous
Not applicable
Author

Hi
This is a known issue, the problem is that that a tag like "16x32" is not a valid XML tag, so JSON-to-XML auto-conversion does not work, I think you should read this sequence as String and then process it manually,
Most likely you will need to use JSONObject and JSONArray from JSON.org. For example, you may want to use tJava to refer to the JSON library; note Jettison 1.3.4 shipped with 5.4.1 has these classes in 'org.codehaus.jettison.json' package. Or may be a related JIRA Java package is available.
HTH, Sergey
Anonymous
Not applicable
Author

The problem lies within the API2 provided by Jira. This brackets are also not allowed in a well-formed JSON. While using another rest service with the API1 (e.g., https://jira/rest/greenhopper/1.0/rapidviews) the response is well-formed and can be used regularly in Talend.
So the problem wasn't in Talend. It was in Jira.
Now I use tRest--------tExtractJSONFields-------(anything else) to work with the data.
Thanks a lot and I hope someone learns from my mistakes.
Anonymous
Not applicable
Author

Hi, good news;
That said, I think quite a few JSON services offer a pure array representation, i.e,, the one with "", effectively the very first object is JSON array, as opposed to JSON object.
Are you sure JIRA API2 is broken ?
Cheers, Sergey