How do I create JSON Object from Dictionary(String, String)

I want to translate pairs from dictionary (Key:Value) given like this or otherwise transparently:
to this:

Where “fields” is main object, and others string are objects too with they values.

And at the end I want to deserialize this JSON Object to string like this:

{"fields": {"project": {"key": "<projectkey>"}, "summary": "<temat>", "description": "<opis>", "assignee": {"name": "<assignee>"}, "issuetype": {"name": "<issuetype>"}, "customfield_11733": {"value": "Medium"}}}

I need this to configure request to JIRA and pass this JsonString to HttpClient.

Any ideas?

I have this solution in Chilkat code, but the library is paid and I want to replace this solution:

I would like to prepare a universal module where I could give different fields depending on the project.


Please can you try using


to see if it gives you the desired output.

I tried and Json looks like this:

{"fields.project.key":"<project key>","fields.summary":"<topic of issue>","fields.description":"<issue description>","":"3","":"<assigne name>","":"<issue type>"}

with is not the same as:

{"fields": {"project": {"key": "<projectkey>"}, "summary": "<temat>", "description": "<opis>", "assignee": {"name": "<assignee>"}, "issuetype": {"name": "<issuetype>"}, "customfield_11733": {"value": "Medium"}}}

Can you share the source dictionary screenshot please and how the values are added into it. I will have a look . Just a sample one will do.

I haven’t created the source data and dictionary yet because I don’t know if it’s possible. Until now, I have relied on the data contained in the VB.NET code using the Chilkat library:

And let’s take the test data from the code above:

fields.project.key = KeyProject (As String Argument)
fields.summary = Topic (As String Argument)
fields.description = Description (As String Argument) = Assing_To (As String Argument) = 3 = “string”
fields.customfield_11728 = Date.toString (As String Argument)


Will this help (2.8 KB)

1 Like

I’m impressed you did it so quickly.
You solved it in a very simple way and it works as expected!

So I suspected that a few dictionaries would have to be built.
Well done! The topic has been solved :slight_smile:

1 Like

Thank you very much :slight_smile: Glad it helped. Yes for every Json Object, we build a dictionary and add it to the main dictionary.

Happy automation :slight_smile:

1 Like

Sowmya I slightly tuned your solution to my needs to make it easier to enter data and process it into a result. I am posting a project for future interested people.

Dictionary_To_Json.7z (23,8 KB)

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.