Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
How to format Array value in slack json string

I want to send slack notification for my test result.

here is my Array

TestCase Name : [Test 1,Test 2,Test 3r]

TestCase Status : [true,false,false]

How do i create this string using javascript.

Here is my JsonString i Want using javascript



{
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "WebDriverIO Automation Status .\n\n *Following are details:*"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 1"
                },
                {
                    "type": "mrkdwn",
                    "text": " :negative_squared_cross_mark: "
                }
            ]
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 2"
                },
                {
                    "type": "mrkdwn",
                    "text": " :x: "
                }
            ]
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 3r"
                },
                {
                    "type": "mrkdwn",
                    "text": " :x: "
                }
            ]
        }
    ]
}

Slack Webhook:

axios.post(
            "hook url",
            {
                text: `${asJSON}`,
            }
        );
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!