Forum Discussion

Mavit's avatar
Mavit
Regular Visitor
3 years ago

JSON Stop transformation If table is empty

Hi!

I have a report where every day is refreshed from the JSONfile with tickets generated from Jira. Sometimes In this file, tickets do not exist and then I have the below message.

 

An error occurred in the ‘Transform File (3)’ query. Expression.Error: The column 'expand' of the table wasn't found. Details: expand

 

File without Tickets:

{"startAt":0,"maxResults":1000,"total":0,"issues":[]}

 

File with tickets:

{"expand":"names,schema","startAt":0,"maxResults":1000,"total":1,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"460508","self":"https://jira.3shape.com/rest/api/2/issue/460508","key":"ITHD-123647","fields":{"components":[{"self":"https://jira.3shape.com/rest/api/2/component/19265","id":"19265","name":"AX"}]}}]}

 

I have any possiility stop transforming file if table issue is empty? 

2 Replies

  • aj1973's avatar
    aj1973
    Community Champion

    Hi Mavit 

    adding a code in the extraction script of the JSON files is the best way.

    Exemple with Powershell extraction :

     

    • Mavit's avatar
      Mavit
      Regular Visitor

      All data are extracted in JSON file, just something table issue is empty, becouse I don't have an issue in Jira under API response