Six Stars

How to re structure my JSON structure ?

Hi Talend community,

 

During my searching, I would like advice about this problem.

 

From this JSON file :

 

the json squeletonthe json squeleton

I am searching to repeat this structure each time I have one line of content in this label : 

"summary": "blah blah",

That is :

{
	"issueUpdates": [{
			"fields": {

				"project": {
					"key": " "
				},
				"summary": "",
				"description": "",
				"issuetype": {
					"name": ""
				},
				"reporter": {
					"name": ""
				},
				"assignee": {
					"name": ""
				},
				"labels": [""]
			}


		},

		{
			"fields": {
				
				"project": {
					"key": " "
				},
				"summary": "",
				"description": "",
				"issuetype": {
					"name": ""
				},
				"reporter": {
					"name": ""
				},
				"assignee": {
					"name": ""
				},
				"labels": [""]
				
				
			}
		}
	]
}

You see I would like to repeat a lot of times the structure fields and within one line of content in "summary".

 

For this thing I use the componant tWriteJSONField where I defined this JSON structure :

image.png

 

But in out, I have this JSON structure :

image.png

 

And I would like one structure " fields " by one " summary " content line. I am sure there is an error in my definition of JSON structure (tWriteJSONFields). 

Any clues ?

4 REPLIES
Five Stars

Re: How to re structure my JSON structure ?

Six Stars

Re: How to re structure my JSON structure ?

Hi,

I'm back ! Thanks for the link rsmits. I am trying tJSONDocOpen and tJSONDocOutput. Please, could anyone tell me if I am in the good direction ?

Thanks,

Five Stars

Re: How to re structure my JSON structure ?

Hi Alexandre44,

 

I have written an howto at my Blog: http://talendhowto.com/2017/10/22/how-to-built-a-json-string-with-arrays/

 

I think this will help you!

 

Regards,

Remco

Six Stars

Re: How to re structure my JSON structure ?

Hi,

Thanks you very much Remco. I will study It.

Alexandre44