Pedro Esposito Posted June 18, 2019 Share Posted June 18, 2019 Hello, We are trying to connect Spotifre to Jira through its API, which returns a JSON. We had some success through an ironpython script. However, the password has to be hardcoded into the script. Is there any way to show an input popup from ironpython Using input controls writing to document properties it works, but there may be some security issues. Willa property be stored or transmitted unencrypted Also, I couldn't consistently keep an input field's text always hidden, even using javascript. When trying to use TDV, we had issues while readingJIRA's JSON. Has anyone ever had success in this Thank you in advance! Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted June 18, 2019 Share Posted June 18, 2019 If you have TDV then it would be a better approach. Have you looked into this article on how to consume REST services get JSON data and convert to tabular format to retrieve it in Spotfire, https://community.spotfire.com/wiki/calling-rest-api-using-tibco-spotfire-and-advanced-data-services Link to comment Share on other sites More sharing options...
Pedro Esposito Posted July 8, 2019 Author Share Posted July 8, 2019 Hello Shandilya,Thank you for your answer! We were able to make it work, with the exception of the "assignee" field, which is one of the most important fields from the API. Some of its attributes start with numbers (e.g. 16x16), which generate invalid XML tags, and return an error. Do you know how can we make TDV ignore or rename these fieldsThank you in advance. JSON excerpt:"assignee" : {"self" : https://jira...,"name" : xxxx,"emailAddress" : johndoe@test.com,"avatarUrls" : {"16x16" : https://jira...,"24x24" : https://jira...,"32x32" : https://jira...,"48x48" : https://jira...}"displayName" : John Doe,"active" : true} Error:An internal error has occurred. Cause: Cannot decode parameter "result" at position 0 to data type XMLcom.compositesw.cdms.webapi.WebapiException: An internal error has occurred. Cause: Cannot decode parameter "result" at position 0 to data type XML Cannot decode parameter "result" at position 0 to data type XML at com.compositesw.common.CompositeRuntimeException.rethrow(CompositeRuntimeException.java:138) at com.compositesw.cdms.ds.rest.RestRequest.invoke(RestRequest.java:69) at com.compositesw.server.request.HookProcedureRequest.invoke(HookProcedureRequest.java:79) at com.compositesw.cdms.webapi.service.WProcResultImpl$InvokerThread.run(WProcResultImpl.java:755) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.compositesw.cdms.datasource.IafException: Cannot decode parameter "result" at position 0 to data type XML at com.compositesw.cdms.ds.rest.RestConnection.callRestService(RestConnection.java:550) at com.compositesw.cdms.ds.rest.RestConnection.call(RestConnection.java:120) at com.compositesw.cdms.ds.rest.RestRequest.invoke(RestRequest.java:57) ... 5 more Caused by: java.lang.IllegalStateException: Cannot decode parameter "result" at position 0 to data type XML at com.compositesw.cdms.ds.rest.RestConnection.callRestService(RestConnection.java:524) ... 7 more at com.compositesw.cdms.webapi.WebapiException_SOAPSerializer.doDeserialize(WebapiException_SOAPSerializer.java:58) at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:209) at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:172) at com.compositesw.cdms.webapi.service.WMetaDataSvc_procresult_getOutputValues_Fault_SOAPSerializer.deserializeDetail(WMetaDataSvc_procresult_getOutputValues_Fault_SOAPSerializer.java:54) at com.sun.xml.rpc.encoding.SOAPFaultInfoSerializer.doDeserialize(SOAPFaultInfoSerializer.java:151) at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:209) at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:172) at com.compositesw.cdms.webapi.service.WMetaDataSvc_Stub._readBodyFaultElement(WMetaDataSvc_Stub.java:24612) at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:238) at com.compositesw.cdms.webapi.service.WMetaDataSvc_Stub.procresult_getOutputValues(WMetaDataSvc_Stub.java:7341) at com.compositesw.cdms.webapi.WProcResult.getOutputParameterCount(WProcResult.java:36) at com.compositesw.ui.modeler.view.result.ComplexProgressTasks$ComplexExecuteQueryTask.displayQueryResult(ComplexProgressTasks.java:508) at com.compositesw.ui.modeler.view.result.Comp Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted July 10, 2019 Share Posted July 10, 2019 I believe you get the error when trying to convert Json response to tabular format in TDV. Can you try using JSON_Table function to convert Json response to tabular format instead of XML and see if it helps Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now