Unable to parse the Web response data in JSON format.

shriya January 15, 2025

I need to pass the Web Response data in JSON format to Github Actions workflow as input using Jira Automation Rule.

JSON data expected -

results : [ {

                  jira: {

                            key: Test-123

                            summary: Testcase

                        }

              },

              {

                  jira: {

                            key: Test-125

                            summary: Testcase

                        }

              },

              {

                  jira: {

                            key: Test-126

                            summary: Testcase

                        }

              }

            ]

 

Getting data in non JSON format.

Example -

{jira={key=TEstcase-123, summary=Test 1 - New feature 1 , status=}},

 

{jira={key=TEstcase-123, summary=Test 1 - New feature 1 , status=}}

 

Anyhelp shall really help, as I am stuck in parsing the data.

 

Thanks,

Shriya

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Sahir Maharaj
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2025

Hello @shriya

Based on my experience, parsing web response data in JSON format often requires modifying the response structure in your automation rule.

I recommend to verify that the response adheres to proper JSON standards and adjust the rule accordingly. Using a script to transform the response into the desired format might also help.

If further assistance is needed, I suggest reaching out to Atlassian support for guidance at https://support.atlassian.com/contact/#/.

 

shriya January 16, 2025

Hi  Sahir,

Thanks for your response. Yes after going through different posts, that seems to be the way. 

Would like to know, is there way to loop in and iterate over the data to retrieve keys only.

I am trying below method -

{{#webResponse.body.data.getTestExecutions.results.get(0).tests.results.jira.key.split(", ")}} {{.}} {{/}}

 

Getting Data as -

complete data -> [TEST-254] [TEST-255] [TEST-256] [TEST-257] [TEST-258]

This is not in JSON format.

Would like to know insights. Is there a way to get only 'keys' through iteration and send as input GIthub Actions.

Thanks,

Shriya

 

TAGS
AUG Leaders

Atlassian Community Events